Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] Cannot have _DEBUG defined
QtWS25 Last Chance

[Solved] Cannot have _DEBUG defined

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 7.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dart
    wrote on last edited by
    #1

    Hi,

    I need to have _DEBUG defined when compiling my symbian project in debug mode. I've added this to my .pro file:

    @CONFIG(debug, debug|release) {
    DEFINES += _DEBUG
    }@

    The problem is that this is never defined. It works fine for any other value (DEBUG without '_', _FOO, MYDEFINE, etc...) but not with _DEBUG, and that's the define I need because I'm using common code used in other projects, platforms and tools...

    I'm using Nokia Qt SDK 1.1 beta.

    Any idea?
    Thanks

    1 Reply Last reply
    0
    • frankcyblogic.deF Offline
      frankcyblogic.deF Offline
      frankcyblogic.de
      wrote on last edited by
      #2

      The GNU compiler automatically defines NDEBUG if this is not a debug build. Maybe you add some lines:
      @
      #ifndef NDEBUG
      #define _DEBUG
      #endif
      @

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dart
        wrote on last edited by
        #3

        Well, I checked the generated Makefile and my DEFINES line is correct:

        @DEFINES = -DSYMBIAN -DUNICODE -DNETWORKACCESS -D_DEBUG@ and some others

        The problem is that if I do
        @#ifdef _DEBUG
        qDebug() << "test";
        #endif@
        it's not taken into account by:

        • Qt Creator: it stays in a grey area
        • make because my debug output is not displayed
        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Is the Makefile you're looking into acutally used by the make command that Creator calls? I'm regularly trapped by default shadow builds where the Makefile and output is in another directory.

          I just checked with the local Creator and it works as you would expect it.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dart
            wrote on last edited by
            #5

            OK, my mistake... Even if I checked lots of things before posting here, I overlook a #undef _DEBUG somewhere in an included header file.
            Thanks for your help

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved