Results 1 to 8 of 8

Thread: Some building questions

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Some building questions

    Hi.
    I've managed to build Qt programs by giving the commands
    qmake -project
    qmake
    make -f Makefile.Release

    But I'd rather just do

    qmake -project
    qmake
    make
    and get the executable in the current directory. Not in the Release directory. How can I do that?

    The second question is: Are the programs dynamic or static built? Can I swtich between these two modes in any easy way?

  2. #2
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: Some building questions

    I hope refering to QtForum won't be punished
    Here's a solution for your first question.

  3. #3
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    Nice! Now I need some help with a custom made makefile.

    Qt Code:
    1. all:
    2. qmake -project
    3. qmake
    4. make
    To copy to clipboard, switch view to plain text mode 

    The line

    Qt Code:
    1. CONFIG -= debug_and_release debug_and_release_target
    To copy to clipboard, switch view to plain text mode 

    should be added to the <projectname>.pro file automatically, how can I do that in a nice simple automatic way?
    Any ideas?

  4. #4
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    You might do one of the following:
    • qmake -project "CONFIG -= debug_and_release debug_and_release_target"
    • qmake "CONFIG -= debug_and_release debug_and_release_target"
    • Comment out debug_and_release and debug_and_release_target from %QTDIR\mkspecs\win32-g++\qmake.conf file

  5. #5
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    So simple! Thanks, now I finaly almost have a working Dev-C++ and Qt environment!

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    Quote Originally Posted by Morea
    Nice! Now I need some help with a custom made makefile.

    Qt Code:
    1. all:
    2. qmake -project
    3. qmake
    4. make
    To copy to clipboard, switch view to plain text mode 
    You might run into troubles with such rule. "qmake -project" will include in your .pro file all files that look like sources from the current directory and all of its subdirectories. If there will be some autogenerated files left (for example moc output), you might get linker errors.

  7. #7
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    Yes, but if I use a separate directory for each project I will stay clear of the problems.
    Yes, it's a mess, but dev-c++ is a total crap when it comes to Qt integration.
    I'm waiting for a Qt and C++ development IDE.

    But regarding the moc files, I've tried to rebuild the code a few times and it seems to ignore the
    moc_mainwindow.cpp file.
    Is this qmake beeing clever and making a good guess about files beginning with moc_ ?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some building questions

    Quote Originally Posted by Morea
    Is this qmake beeing clever and making a good guess about files beginning with moc_ ?
    I guess it's clever enough to skip them, but I recall that few people had problems with too much entries in a .pro file.

Similar Threads

  1. Problem building application with custom widget
    By Uthar in forum Installation and Deployment
    Replies: 6
    Last Post: 19th January 2009, 17:57
  2. Replies: 1
    Last Post: 19th November 2007, 01:34
  3. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  4. 2 Questions about layouts
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2006, 13:54
  5. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

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.