Using __WXDEBUG__

General questions regarding the usage of CodeLite
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Using __WXDEBUG__

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using __WXDEBUG__

Post 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
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using __WXDEBUG__

Post 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
Post Reply