Menu

Disabeling __DEBUG__?

oliver
2004-06-02
2012-09-26
  • oliver

    oliver - 2004-06-02

    Hi,

    I can't seem to find the option to disable debug builds. I let Dev-CPP 'auto' turn them on (when starting the built in Debugger) but now i can't turn it off. I edited the make files manually (where it says CC=gcc.exe -D__DEBUG__ but whenever i start dev-cpp it just puts them back in, so there must be an option 'some' where ... So unless i overlooked something, I can't seem to find anything to disable the debuger (to build a final, debug symbol free binary)

     
    • Brian

      Brian - 2004-06-02

      Goto Tools->Compiler Options->Settings->Linker->Generate Debugging Info->No
      :)

       
    • oliver

      oliver - 2004-06-03

      that IS at no ...
      besides, why would that be at Linker options? As the compiler compiles the code with -D__DEBUG__ ... wouldn't it be under compile options?

      that's why it's so confusing : )

       
    • Anonymous

      Anonymous - 2004-06-03

      The __DEBUG__ macro definition does not control whether debug information is compiled, it is merely set by the IDE when debug information is requested in order that you can build different code for debug builds than for release builds using pre-preocessor code such as:

      #if defined __DEBUG__
      ...
      #endif

      The option that controls debug information is -g. When debug is requested the IDE sets both -g and -D__DEBUG__.

      However you are correct in that -g is a compiler option not a linker option. The linker can remove debug information compiled into object files using -S(strip debug symbols) or -s(strip all symbols). So the linker is relevant, but I in actual fact Dev-C++ does not insert either of these symbols when debug is disabled.

      Clifford.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.