PDA

View Full Version : How to compile from command line?



tonnot
15th March 2011, 08:49
I'm a little lost.
Can I compile my project from command line after makefile is ready (Windows system and mingw) ?
How ?
Thanks

SixDegrees
15th March 2011, 09:05
Type 'make'.

ChrisW67
15th March 2011, 09:05
Start the "Qt Command Prompt" then:


cd {my project dir}
qmake
mingw32-make

or a variation on that theme.

agarny
15th March 2011, 09:08
Yes, all you need is for you to have access to qmake and mingw32-make (i.e. make sure your PATH environment variable includes the folders where qmake and mingw32-make are). From there, all you need to do is call qmake and then mingw32-make.

MarekR22
15th March 2011, 10:02
I'm handling multiple versions of Qt so:
on windows I usually create *.bat files win \windows\system32 directory which are calling qmake (I have qmake47.bat, qmake46.bat).
On Linux I use aliases.

tonnot
15th March 2011, 10:25
Thanks to every body.
A last question :
I have see the QtCreator project settings and I dont understand how QTCreator are saying Make that use the debug or the release build configuration....
Qmake has the correct paths but for make :
I see mingw32-make.exe -w in d:\myc++\myprog-build-desktop
How make choose between debug and release ?
And How can I specifie this at command line ?
Thanks

wysota
15th March 2011, 14:55
I'm handling multiple versions of Qt so:
on windows I usually create *.bat files win \windows\system32 directory which are calling qmake (I have qmake47.bat, qmake46.bat).
On Linux I use aliases.

Trolls have a nice way of handling it. They have a "qenv" (or similar) script where you pass the version number as the argument and it adjusts the PATH (and possibly other variables) in such a way that the right version comes first and is activated. So it all boils down to:

$ qenv 4.6
$ qmake
$ make

$ qenv 4.7
$ qmake
$ make

I personally just use the full path to the right qmake.


How make choose between debug and release ?
It doesn't. qmake does.

And How can I specifie this at command line ?
qmake -config release