Page 1 of 1

Using __WXDEBUG__

Posted: Mon Nov 11, 2013 6:04 pm
by ColinTaylor
Hi, not sure where this problem is

Windows 8 64-bit
Codelite 5.3
wxWidgets 2.9.5
MinGW-4.7.1

1. Create a new codelite project (Executable (WxWidgets + wxFBFrame))

2. In "main.cpp", add the following code after

Code: Select all

#include "main.h"

Code: Select all

#ifdef __WXDEBUG__
#error This program must be compiled in debug mode.
#endif
3. The program fails to compile in both the Debug and Release configurations. I was expecting it to not compile in Release, but it should compile in Debug config?

4. I'm not sure if it's relevant ... wxDEBUG_LEVEL is set to 1

Please can someone explain this?
Thanks, Colin

Re: Using __WXDEBUG__

Posted: Mon Nov 11, 2013 6:24 pm
by eranif
It looks like the the template files are not up to date.
With wx2.9.X and later, the way to distinguish between debug and release is by using the NDEBUG macro (defined in Release build)

Eran

Re: Using __WXDEBUG__

Posted: Mon Nov 11, 2013 6:35 pm
by ColinTaylor
Many thanks for the fix, which works perfectly.

Not sure about what you mean about "the templates", I think its the wxWidgets documentation (http://docs.wxwidgets.org/3.0.0/group__ ... debug.html) that could do with a better explanation!

Colin