PDA

View Full Version : Compiling cpp files with qt cmd



Noks
16th January 2010, 13:39
Hello all,
I am having some errors with my use of qmake command.this is what i did:
1.created a cpp file.
2.in qt cmd i wrote qmake -project hello.cpp;this created project file
3.then in the cmd i wrote qmake,this created the make files and debug files..etc
BUt the problem is there is no executable file in any folder say neither in debug or release.so how do i get the executable file..i am comfortable with the ide but how to use the cmd....
Thanks

squidge
16th January 2010, 16:39
Did you try 'mingw32-make' ?

Noks
16th January 2010, 17:06
Hey,,,
this mingw32-make does not even generate the makefile which qmake used to do.....
1. i created a cpp file
2.in qt cmd,i did mingw32-make -project hello.cpp
and no make files wer found!

jpn
16th January 2010, 17:40
qmake does not build anything. It merely creates makefiles and project files. Use a make tool appropriate to your environment to build after you have generated makefiles with qmake.

Noks
16th January 2010, 17:55
Hey,
could you be more specific please...Well m using windows xp...and qt creator 1.3.0
Thanks

squidge
16th January 2010, 17:57
'mingw32-make' is an ADDITIONAL step, not a REPLACEMENT. You still need to use qmake to generate the makefiles.

Noks
16th January 2010, 18:33
Could you please explain in detail why to use qmake or mingw32-make?

squidge
16th January 2010, 19:19
qmake creates makefiles from project files (and can also create project files, given the appropriate options)
mingw32-make takes those makefiles and compiles your application into an executable for mingw32 environment. If you want to compile for alternative environment (such as MSVC++ or Linux) then you would use a different make command.

Therefore, you need to use both. Unless of course you want to skip both qmake and mingw32-make and run gcc directly yourself.

Noks
16th January 2010, 19:58
Well thanks a lot...:)