Results 1 to 2 of 2

Thread: debug invironment variable

  1. #1
    Join Date
    Apr 2011
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default debug invironment variable

    Hello,

    is there and environment variable (automatically set) that I can check to find out if the program is running in release or debug mode?
    I would like to do something like the code below, assuming there is and ENV variable (i.e. IS_DEBUG) that is set only when in debug mode.
    Qt Code:
    1. #ifdef IS_DEBUG
    2. // do something
    3. #else
    4. // don't do it
    5. #endif
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: debug invironment variable

    Qt Code:
    1. #ifdef QT_DEBUG
    2. #else
    3. #endif
    To copy to clipboard, switch view to plain text mode 

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

    scieck (7th November 2011)

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: 4
    Last Post: 30th September 2010, 11:31
  3. DEBUG macro not defined in debug build using vc++
    By piotr.dobrogost in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2009, 14:07
  4. "Debug Assertion failed" in debug mode
    By hed in forum Qt Programming
    Replies: 10
    Last Post: 4th February 2008, 13:10
  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.