wxWidgets Debug Alert in Release-Build

1,110 views
Skip to first unread message

Karl Karpfen

unread,
Feb 19, 2015, 1:37:49 AM2/19/15
to wx-u...@googlegroups.com
Hi,

when I start my application it shows up an assert with an wxWidgets Debug Alert window. The reason for this alert is clear (and will be removed). More amazing for me: this happens in release build! So has there changed anything in wxWidgets 3 which lets these alerts pop up? As far as I know all related libraries are build as release and nowhere the _DEBUG option is set. So are there any other conditions that could cause this alert window?

Thanks :-)

Eran Ifrah

unread,
Feb 19, 2015, 1:44:19 AM2/19/15
to wx-u...@googlegroups.com
You did not mention your OS, If you are on Windows using the MinGW suite, I use these steps to build my wxWidgets:

Following the above steps builds wxWidgets in debug_level=0

However, I think that passing -DNDEBUG when building your application should be enough for removing these kind of popup alerts



--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to wx-users+u...@googlegroups.com
or visit http://groups.google.com/group/wx-users



--
Eran Ifrah,
Author of codelite, a cross platform open source C/C++ IDE: http://www.codelite.org

Allann Jones

unread,
Feb 19, 2015, 7:48:38 AM2/19/15
to wx-u...@googlegroups.com
On Thu, Feb 19, 2015 at 2:43 AM, Eran Ifrah <eran....@gmail.com> wrote:
You did not mention your OS, If you are on Windows using the MinGW suite, I use these steps to build my wxWidgets:

Following the above steps builds wxWidgets in debug_level=0

However, I think that passing -DNDEBUG when building your application should be enough for removing these kind of popup alerts



On Thu, Feb 19, 2015 at 8:37 AM, Karl Karpfen <karlka...@gmail.com> wrote:

Hi,

when I start my application it shows up an assert with an wxWidgets Debug Alert window. The reason for this alert is clear (and will be removed). More amazing for me: this happens in release build! So has there changed anything in wxWidgets 3 which lets these alerts pop up? As far as I know all related libraries are build as release and nowhere the _DEBUG option is set. So are there any other conditions that could cause this alert window?

Karl Karpfen

unread,
Feb 20, 2015, 4:22:35 AM2/20/15
to wx-u...@googlegroups.com

2015-02-19 13:48 GMT+01:00 Allann Jones <alla...@gmail.com>:

This seems to be the solution - thanks! 

Karl Karpfen

unread,
Feb 23, 2015, 5:52:28 AM2/23/15
to wx-u...@googlegroups.com
OK, I don't get it working. When I set a

#define wxDEBUG_LEVEL 0

at the very first beginning the assert dialogue is still there. When I try it with

#include <wx/app.h> 
wxDISABLE_DEBUG_SUPPORT()

I get several compiler errors:

'int wxDisableAsserts(void)' : overloaded function differs only by return type from 'void wxDisableAsserts(void)'
'wxDisableAsserts' : redefinition; different basic types



Vadim Zeitlin

unread,
Feb 23, 2015, 9:21:01 AM2/23/15
to wx-u...@googlegroups.com
On Mon, 23 Feb 2015 11:52:25 +0100 Karl Karpfen wrote:

KK> OK, I don't get it working. When I set a
KK>
KK> #define wxDEBUG_LEVEL 0
KK>
KK> at the very first beginning the assert dialogue is still there.

You need to rebuild wxWidgets with wxDEBUG_LEVEL=0. However I don't
recommend doing it unless you really, really need to make the smallest
possible binaries. It's much better to leave the debugging checks in and
disable them in the production version but still be able to enable them if
necessary.

KK> When I try it with
KK>
KK> #include <wx/app.h>
KK> wxDISABLE_DEBUG_SUPPORT()
KK>
KK> I get several compiler errors:
KK>
KK> 'int wxDisableAsserts(void)' : overloaded function differs only by return
KK> type from 'void wxDisableAsserts(void)'
KK> 'wxDisableAsserts' : redefinition; different basic types

wxDISABLE_DEBUG_SUPPORT() must be inside your main() function. Also, you
usually don't need to call it explicitly, the standard solution is to
define NDEBUG for your release build, then this will be done for you by the
standard wxIMPLEMENT_APP() macro.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Karl Karpfen

unread,
Feb 26, 2015, 1:15:31 AM2/26/15
to wx-u...@googlegroups.com
Am Montag, 23. Februar 2015 15:21:01 UTC+1 schrieb Vadim Zeitlin:
On Mon, 23 Feb 2015 11:52:25 +0100 Karl Karpfen wrote:

 wxDISABLE_DEBUG_SUPPORT() must be inside your main() function.

OK, I'll try that - thanks!
 
Reply all
Reply to author
Forward
0 new messages