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

Offline gd_on

  • Lives here!
  • ****
  • Posts: 799
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, 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 ?

Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.5 (tests with 3.3), Msys2 Compilers 14.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1605
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:

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.