Results 1 to 5 of 5

Thread: disable qDebug in Visual Studio Release Version

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60

    Default disable qDebug in Visual Studio Release Version

    Hi,

    I'm wanna disable all qDebug output in my release version, not in Debug version.

    I found that for QtCreator, we can use QT_NO_DEBUG_OUTPUT in .pro file but in Visual Studio 2010,

    I could not find any right place to put this??

    Anyone know? I'm using Qt 4.8 with visual studio Add in

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,734
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: disable qDebug in Visual Studio Release Version

    It goes wherever the IDE allow you to inject #defines into the command line. That's the DEFINES variable in a Qt pro file and "Project Settings -> C/C++ -> Preprocessor -> Preprocessor definitions" under VS 2005. Try hunting around in 2010 for the same thing. I imagine putting it in the pro file and reimporting it into VS will also do it.

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

    tranthudo (8th November 2012)

  4. #3
    Join Date
    Mar 2011
    Posts
    82
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: disable qDebug in Visual Studio Release Version

    Why would you want something clearly used for debuggin in your release build? Just remove them.

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,734
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: disable qDebug in Visual Studio Release Version

    That is precisely what the pre-processor define does... removes them from the release build while maintaining their utility in a debug build from the same source. Warning and Debugging Messages

  6. The following user says thank you to ChrisW67 for this useful post:

    tranthudo (8th November 2012)

  7. #5
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60

    Default Re: disable qDebug in Visual Studio Release Version

    Thanks ChrisW67 it help so much.
    @alitoh: I don't wanna do a lot of these debug lines removal, because I wanna use it latter when I have to debug again.

Similar Threads

  1. Replies: 2
    Last Post: 8th June 2012, 16:34
  2. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 17:46
  3. Release date for Visual Studio 2010 AddIn
    By Gargolissimus in forum Qt Tools
    Replies: 1
    Last Post: 3rd June 2010, 04:29
  4. Replies: 5
    Last Post: 5th October 2008, 06:12
  5. Disable qDebug output
    By the_bis in forum Qt Programming
    Replies: 7
    Last Post: 30th November 2006, 21:14

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.