Results 1 to 4 of 4

Thread: Setting up Debug / Release Qt Libraries on Linux

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

    Default Setting up Debug / Release Qt Libraries on Linux

    I want to have both Debug and Release versions of the Qt libraries on my Linux system such that I can build both versions of my application side by side. I want to do what I can do on Windows simply by specifing either the Debug or Release build from within Qt Creator.

    Nicely enough on Windows you get a .debug and .release version of your make file. I know how to use the debug/release settings in the project.pro file so I can control the compiled output of my apps code, but I'm stuck on getting the correct Qt library.

    I need to be able to debug down into the Qt libraries from time to time. At this point the only way I can do this is to build two versions of the Qt environment and install them into the what appears to be the 'same' directory. I then rename the directories according to which version of the Qt libraries I want to use.

    QT_INSTALL_LIBS in qmake seems to be the limiting factor. Can both the debug and release versions of the Qt libraries be in the same directory like windows? I'm not a Linux expert so I am not fully aware of what I can do with Linux libraries, etc.

  2. #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.

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

    Dong Back Kim (9th August 2011)

  4. #3
    Join Date
    Aug 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post

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

    Oh, and don't forget to install the fontconfig-dev library. Depending on your Linux version if you do not include this your default Font will look really bad. For more info see here:

    http://www.qtcentre.org/threads/3958...o-Ubuntu-10.10

  5. #4
    Join Date
    Nov 2010
    Posts
    122
    Thanks
    62
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

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

    Are the debug libraries for 64-bit Linix available for download? I can not find anything other than release bulid for the 4.7.4 SDK

Similar Threads

  1. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 07:27
  2. Replies: 5
    Last Post: 14th April 2011, 20:10
  3. Debug libraries
    By enno in forum Installation and Deployment
    Replies: 3
    Last Post: 9th February 2011, 18:18
  4. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 14:58
  5. Replies: 11
    Last Post: 22nd March 2006, 20: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.