PDA

View Full Version : Getting Started



Hockey
29th November 2007, 19:55
I've poke around the forums and Googled on getting started with Qt. When I initially downloaded I was under the impression it also came with an IDE. However now it appears it's everything BUT the IDE. This is OK because I am already familiar with Visual Studio although I no longer develop using it, instead I prefer to use UltraEdit for all my web development needs.

I am interested in picking up some C++ again but wanted cross platform and decided to try Qt out.

Can someone point me in the direction in just getting started setting up the proper tool chain required to compile a basic Widget window?

It sounds like I use qmake to generate a project file and that project file will invoke all the proper tools in order to generate an executable?

I'm using the OSS version so I am using the MinGW compiler. I've looked at the CLI for the Gnu tools and I am sure I could begin stringing togather an application by compiling/linking each source file manually but what a PITA. :)

Using the given toolset, what would be the best way to begin?

Thanks :)

jacek
29th November 2007, 20:17
It sounds like I use qmake to generate a project file and that project file will invoke all the proper tools in order to generate an executable?
qmake generates makefiles from much simplier .pro files with all of the rules that Qt needs for compilation.


Using the given toolset, what would be the best way to begin?
Read this:
http://doc.trolltech.com/4.3/tutorial.html
http://doc.trolltech.com/4.3/qmake-tutorial.html
http://doc.trolltech.com/4.3/designer-using-a-component.html

Hockey
29th November 2007, 20:49
Thanks for the speedy reply.

I've read those articles and tried to build a simple, single file application but I am getting the following error:


mingw32-make: *** No rule to make target `test.pro', needed by `Makefile'. Stop.

What am I doing wrong? I've Googled but nothing really helpful.

Cheers :)

jacek
29th November 2007, 20:51
How does your .pro file look like and what how did you invoke qmake?

Hockey
29th November 2007, 21:05
Edit It just occured to me to look inside my makefile and see if the path were inside the makefile. It seems as though the makefile is just referencing the test.pro and NOT including the path. Ise the environment variables for the MinGW and Qt binaries, do I just add my project path to environment variables as well? I would need to keep the path in the qmake command thought, correct?

This is the contents of my project file:


CONFIG += qt
SOURCES += main.cpp

I copied it verbatim essentially from the tutorials...

I invoked qmake with this command:


qmake.exe -o c:\test\Makefile c:\test\test.pro

jacek
29th November 2007, 21:07
Everything OK so far. How did you invoke make?

Hockey
29th November 2007, 21:19
make --makefile=c:\test\Makefile

I've tried several switches but no luck... :(

jacek
29th November 2007, 21:21
Does it work if you invoke:

cd c:\test\
make?

Hockey
29th November 2007, 21:26
Zing!!!

That did the trick. Although it compiled as release not debug. Does this mean I have too add my project path to environment variables?

jacek
29th November 2007, 21:43
That did the trick. Although it compiled as release not debug.
Most likely it's because you don't have the debug version of Qt libraries. Look for "Build Qt libraries in debug mode" or something similar in the Start menu.


Does this mean I have too add my project path to environment variables?
No, I've just reproduced your problem on my system. It seems that qmake generates Makefiles which expect that the .pro file is in the current directory. So you just have to make sure that your project's directory is the current one.