Results 1 to 8 of 8

Thread: qmake and debug output

  1. #1
    Join Date
    Mar 2006
    Location
    belgium
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qmake and debug output

    hi

    I've put the following in my qmake project file:
    release {
    DEFINES += QT_NO_DEBUG_OUTPUT
    }
    My goal is to disable debug output in the release build. However, when I specify it like above, debug output is also disabled in the debug build. What am I doing wrong?

    tia
    matthias

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

    Default Re: qmake and debug output

    Hmm... but debug output is disabled in release build... Could you show your complete project file?

  3. #3
    Join Date
    Mar 2006
    Location
    belgium
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake and debug output

    if I don't explicitly define it, I see the -DQT_NO_DEBUG directive, but not the QT_NO_DEBUG_OUTPUT one. problem with the explicit definition is that it also applies for debug build then (though I tried to make it conditional).

    I'm using Qt 4.1.0 open source edition with mingw32
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2006
    Posts
    31

    Default Re: qmake and debug output

    on top of your project file, try add these lines:

    CONFIG -= release
    CONFIG += debug

    .....

  5. #5
    Join Date
    Mar 2006
    Location
    belgium
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake and debug output

    okay, this helps... but this would mean I need 2 project files, one for release and one for debug, right? defeats a bit the existance of conditional statements imo..?

    I have recently upgraded from qt 4.1.0 to 4.1.4 and still have the same problem, weird..
    I'm on windows

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

    Default Re: qmake and debug output

    Quote Originally Posted by mattie View Post
    okay, this helps... but this would mean I need 2 project files, one for release and one for debug, right?
    Wrong. You can always pass "CONFIG+=debug" (or other) as a commandline parameter to qmake, you don't need to change the project file.

  7. #7
    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 and debug output

    Quote Originally Posted by wysota View Post
    Wrong. You can always pass "CONFIG+=debug" (or other) as a commandline parameter to qmake, you don't need to change the project file.
    Wrong way...

    use qmake's "-config" switch instead if you really want to do it that way...

    If you want to use debug_and_release then here is the way to go :
    Qt Code:
    1. CONFIG(debug, debug|release) {
    2. #debug specific code here
    3. } else {
    4. #release specific code here
    5. }
    To copy to clipboard, switch view to plain text mode 

    And everything will be allright...
    Current Qt projects : QCodeEdit, RotiDeCode

  8. The following user says thank you to fullmetalcoder for this useful post:

    sunil.thaha (18th September 2006)

  9. #8
    Join Date
    Mar 2006
    Location
    belgium
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake and debug output

    thanks, this did the trick
    though I still have the feeling this is probably default behavior in a standard install, so it makes me wonder whether something is wrong with my qt install. But anyhow, it's really a joy now to make release AND debug builds with proper output =)

Similar Threads

  1. Qt 4.3.1 & MinGW 5.1.3 & MSYS 1.0 qmake problem
    By mdecandia in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd October 2008, 16:52
  2. qmake debug/release scope and disabling debugging output
    By No-Nonsense in forum Qt Programming
    Replies: 7
    Last Post: 12th March 2007, 15:48
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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.