Results 1 to 9 of 9

Thread: Compiling cpp files with qt cmd

  1. #1
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Compiling cpp files with qt cmd

    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
    Last edited by Noks; 16th January 2010 at 13:46.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    Did you try 'mingw32-make' ?

  3. #3
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    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!

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Compiling cpp files with qt cmd

    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.
    J-P Nurmi

  5. #5
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    Hey,
    could you be more specific please...Well m using windows xp...and qt creator 1.3.0
    Thanks

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    'mingw32-make' is an ADDITIONAL step, not a REPLACEMENT. You still need to use qmake to generate the makefiles.

  7. #7
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    Could you please explain in detail why to use qmake or mingw32-make?

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    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.

  9. The following user says thank you to squidge for this useful post:

    Noks (16th January 2010)

  10. #9
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling cpp files with qt cmd

    Well thanks a lot...

Similar Threads

  1. Replies: 12
    Last Post: 17th June 2009, 05:34
  2. Strange Errors while compiling (QT Header Files)
    By DrDonut in forum Qt Programming
    Replies: 5
    Last Post: 21st May 2009, 13:10
  3. Replies: 0
    Last Post: 23rd April 2009, 09:38
  4. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  5. compiling problem / Qt DLL files
    By ht1 in forum Newbie
    Replies: 1
    Last Post: 5th January 2008, 17:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.