PDA

View Full Version : very newbie, where/how make .pro files?



futes
15th November 2010, 19:21
Ok I'm very new and I don't understand what .pro files are for, or where to actually make them.
I'm trying to do the qmake tutorial http://doc.qt.nokia.com/4.7/qmake-tutorial.html and I don't know what it's talking about when it says to make the project file:



CONFIG += qt
HEADERS += hello.h
SOURCES += hello.cpp
SOURCES += main.cpp

am I supposed to write this in Microsoft visual studio and save it as a .pro file within the project? Or do I write this in a plain text file and save it where the hello.h and hello.cpp files are?

I am confused, please help!

ChrisW67
15th November 2010, 20:45
The PRO file tells qmake how to generate the necessary files to build you project. Those files may take the form of a Makefile or a Visual Studio project file.

The answers to your questions are:


am I supposed to write this in Microsoft visual studio and save it as a .pro file within the project?

Yes, if that is your favourite text editor.


Or do I write this in a plain text file and save it where the hello.h and hello.cpp files are?

Yes. It is a plain text file. As the docs say it should live in the same directory as the sources.

From the third paragraph of the document you linked:

You will find these files in the examples/qmake/tutorial directory of the Qt distribution. The only other thing you know about the setup of the application is that it's written in Qt. First, using your favorite plain text editor, create a file called hello.pro in examples/qmake/tutorial. The first thing you need to do is add the lines that tell qmake about the source and header files that are part of your development project.

marcvanriet
15th November 2010, 22:25
Hi futes,

Just use QtCreator. It will get you started with Qt a lot faster, as it takes care of all these things like creating the .pro file and calling qmake and everything.
You can download prebuild versions of the Qt SDK both for Visual Studio (it must already be on your computer) and for MingW (this gets installed automatically) and they both work with QtCreator.

Best regards,
Marc