Results 1 to 2 of 2

Thread: qmake debug/release scope question

  1. #1
    Join Date
    Sep 2008
    Posts
    11
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question qmake debug/release scope question

    I have a question here. I use Qt4.4.1 in WindowsXP with VS2008. Now, i want to link different libraries for debug and release setups in VS project. I tried to play around with scopes in .pro file but i can't seem to get it right. For example, for Qwt i want to link qwtd5.lib for debug and qwt5.lib for release. This is what i have right now:


    CONFIG += debug_and_release build_all
    CONFIG(debug, debug|release) {
    LIBS += C:\Qt\4.4.1\src\3rdparty\qwt-5.1.1\lib\qwtd5.lib
    } else {
    LIBS += C:\Qt\4.4.1\src\3rdparty\qwt-5.1.1\lib\qwt5.lib
    }
    However, when i create a project with qmake i get qwtd5.lib in both debug and release. Of course if i change CONFIG to

    CONFIG += release

    then i get qwt5.lib everywhere. But i wonder if it's possible to put the right libraries in debug/release with a single pass of qmake.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake debug/release scope question



    Sorry but I'm not sure I understand your problem : your project looks fine to me and it is definitely the only way to get proper linking if you want to build your project in both debug and release mode.

    Are you saying that despite setting up your porject like that you get binaries that always link against the same version of Qwt, regardless of the build?

    If so I only have two suggestions :

    • specify proper TARGET and/or DESTDIR for the targets depending on the build mode (i.e inside the CONFIG() blocks)
    • replace
      Qt Code:
      1. CONFIG(debug,debug|release) {
      To copy to clipboard, switch view to plain text mode 
      with
      Qt Code:
      1. CONFIG(debug,release|debug) {
      To copy to clipboard, switch view to plain text mode 
      . I really don't think it *should* change anything but that's what I'm using in my own projects and things work as expected
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 21:52
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  4. qmake debug/release scope and disabling debugging output
    By No-Nonsense in forum Qt Programming
    Replies: 7
    Last Post: 12th March 2007, 15:48
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.