Results 1 to 7 of 7

Thread: How to compile from command line?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to compile from command line?

    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.

  2. #2
    Join Date
    Nov 2010
    Posts
    315
    Thanked 53 Times in 51 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to compile from command line?

    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.

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to compile from command line?

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to compile from command line?

    Quote Originally Posted by MarekR22 View Post
    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.

    Quote Originally Posted by tonnot View Post
    How make choose between debug and release ?
    It doesn't. qmake does.
    And How can I specifie this at command line ?
    bash Code:
    1. qmake -config release
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QProcess and the command line
    By auba in forum Qt Programming
    Replies: 17
    Last Post: 27th May 2009, 10:39
  2. Printing to Command Line
    By seanmu13 in forum Qt Programming
    Replies: 3
    Last Post: 5th July 2007, 15:57
  3. Starting assistant from command line
    By mderdem in forum Qt Programming
    Replies: 10
    Last Post: 22nd March 2007, 11:27
  4. Is there a command-line window in Qt4?
    By miaoliang in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2006, 08:56
  5. Passing Command Line Values?
    By Kapil in forum Newbie
    Replies: 1
    Last Post: 29th March 2006, 08:26

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
  •  
Qt is a trademark of The Qt Company.