Results 1 to 4 of 4

Thread: Setting up Debug / Release Qt Libraries on Linux

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Aug 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Setting up Debug / Release Qt Libraries on Linux

    This is my solution:

    * Build and install both debug and release versions of the Qt SDK
    That means I have two versions of the SDK installed. My physical directories are:
    Qt Code:
    1. QtSDK/4.7.3
    2. QtSDK/4.7.3-debug
    To copy to clipboard, switch view to plain text mode 

    * In the QtCreator Tools/Options dialog, on the Qt4 page, 'Manually' add the two directories above.
    Remove the 'Qt he PATH' entry
    You can also remove Qt from the PATH. QtCreator will add the qmake and tools back
    into the path for you.

    * From 'Edit build configuration' drop down remove extra entries so you only have the '4.7.3 Release'
    and '4.7.3-debug Debug' entries.

    * Make sure the 'Qt version' is correct for each build configuration. '4.7.3 Release' should be '4.7.3'
    and '4.7.3-debug Debug' should be '4.7.3-debug'. If you need to change this then you probably
    deleted the wrong build configuration.

    * Edit 'qmake' Build Step to make sure the 'CONFIG' value is set. Expand the details,
    if the 'Effective qmake call' does not include a CONFIG value, add it on the
    'Additional arguments' line.

    for 4.7.3-debug Debug:
    Qt Code:
    1. CONFIG+=debug
    To copy to clipboard, switch view to plain text mode 

    for 4.7.3 Release
    Qt Code:
    1. CONFIG+=release
    To copy to clipboard, switch view to plain text mode 

    * To make two build outputs (debug/release) you need to add the following to your .pro file:

    Qt Code:
    1. CONFIG(release, debug|release) {
    2. DESTDIR = release
    3. OBJECTS_DIR = release
    4. }else{
    5. DESTDIR = debug
    6. OBJECTS_DIR = debug
    7. }
    To copy to clipboard, switch view to plain text mode 

    Note that the Makefile will need to be regenerated when switching build configurations, but this
    appears to automatically happen.

    So what you end up with is a fully debuggable version of your app including the Qt libraries and
    a release version of your app with the release libraries, each in there own directory. This makes
    it quick to switch back and forth between build configurations.

  2. The following user says thank you to gmat4321 for this useful post:

    Dong Back Kim (9th August 2011)

Similar Threads

  1. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 06:27
  2. Replies: 5
    Last Post: 14th April 2011, 19:10
  3. Debug libraries
    By enno in forum Installation and Deployment
    Replies: 3
    Last Post: 9th February 2011, 17:18
  4. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 13:58
  5. Replies: 11
    Last Post: 22nd March 2006, 19:06

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.