Author Topic: CodeBlocks/wxWidget 3.11 problem with assert  (Read 132 times)

Offline gd_on

  • Regular
  • ***
  • Posts: 408
CodeBlocks/wxWidget 3.11 problem with assert
« on: May 28, 2018, 11:00:12 am »
With recent CodeBlocks and wxWidgets 3.11 Windows versions, I have sometimes wxWidgets assert debug alerts. But I’m running release version of my codes with a release wxWidgets version. It looks as an internal wxWidgets problem caused by DEBUG_FLAG. There were no such problems with wxWidgets 2.8.12.
I can obtain these messages in different situations difficult to reproduce, but one way to obtain such message is to select a word in a code (a standard word for example as #include), right click on the mouse and choose the sub-popup menu “Search at BlackDuck…”.

This is obtained with version 11400 provided by killerbot (and the corresponding wxmsw31u_gcc_cb_wx311_gcc510-TDM.7z)
With my own compilation of C::B and wxWidgets 3.11 (TDM gcc 4.9.2), I obtain a slightly different window but containing the same message.
This example reveals also another problem: BlackDuck Code search site is discontinued! (but this is another story ! and certainly something to modify in CodeBlocks if this site is definitely closed).

Sometimes, I obtain a wxWidget debug alert, saying that a running instance debug session is active, but I’m only running a release version. This is just annoying and my code, generally, continues to work. But this is hardly reproducible!

I thought that, following indications found in https://wxstuff.xaviou.fr/article/built-libs-install.html, a possible solution (or workaround) was to compile wxWidgets 3.1.1 with the option DEBUG_LEVEL=0 and probably also compile CodeBlock by adding wxDEBUG_LEVEL=0 in compilation options, but the problem is still there. May be I forgot to do something ?

Gd_on
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.1 (64 bits) compiled by TDM 4.9.2 in C:\MinGW64

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: CodeBlocks/wxWidget 3.11 problem with assert
« Reply #1 on: May 28, 2018, 01:13:43 pm »
Just by defining NDEBUG in your application the assertions should go away, see Configuring Debug Support in:

http://docs.wxwidgets.org/3.1/overview_debugging.html

This macro should be already defined in release applications, but the Project Wizard doesn't define it. I think it should, and not only on wxWidgets projects.