Recent Posts

Pages: 1 2 3 4 5 6 [7] 8 9 10
61
Since some users report this assert in relation to clangd_client plugin,
I'll try to recreate the situation and find the cause.
It may take some time since I'm not proficient with Linux.

Gemini 3.0 explains this error as follows:

My query to Gemini 3.0:
Code
 Please explain this message from wxWidgets that occurs more and more with Codeblocks IDE.

wxWidgets Debug Alert

A debugging check in this application has failed.
..\..\include/wx/recguard.h(36): assert "m_flag > 0" failed in ~wxRecursionGuard(): unbalanced wxRecursionGuards!?

Gemini responded;

This specific error is a classic "housekeeping" alert from the wxWidgets library. In short, the program is telling you that it tried to clean up a safety mechanism, but the math didn't add up.
What is a Recursion Guard?

A wxRecursionGuard is a tool developers use to prevent a function from calling itself infinitely (which would crash the program). Think of it like a "Do Not Enter" sign that a function hangs on its door when it starts working. When the function finishes, it takes the sign down.

The error assert "m_flag > 0" failed means that when the function finished and went to take the sign down, it found the sign was already gone - or it found "negative" signs. This is what the message means by "unbalanced."
Why is this happening in Code::Blocks?

Code::Blocks is built using wxWidgets. You are seeing this more often likely due to one of three reasons:

    UI Event Races: Code::Blocks is trying to process a UI event (like a mouse click or a window redraw) while another event is still finishing. This is common if you are clicking rapidly or if the IDE is lagging.

    Plugin Conflicts: A specific plugin (like Code Completion or Symbol Browser) might be triggering a "re-entrant" call, where it starts a task, gets interrupted, and fails to clean up its state properly.

    Build/Version Mismatch: If you recently updated your OS or the IDE, there might be a slight incompatibility in how messages are passed between the system and the wxWidgets layer.

How to Fix or Bypass It

Since this is a Debug Alert, it is technically a warning for the developers of Code::Blocks, not necessarily a sign that your code is broken.

    The "Ignore" Method: Click "Yes" to continue (this usually ignores the specific failure) or "No" to stop debugging. If you click "Cancel," it will likely crash the IDE to trigger a debugger.

    Update Code::Blocks: Check if there is a newer "Nightly Build" or stable release. These "unbalanced guard" bugs are frequently patched in newer revisions.

    Disable Heavy Plugins: Go to Plugins -> Manage plugins and try disabling non-essential ones (like "SpellChecker" or "Occurrences Highlight") to see if the frequency drops.

    The "Silent" Route: If it is driving you crazy, you can run the "non-debug" version of Code::Blocks (the release build), which typically strips out these assert checks so they don't pop up.

clangd_client has some re-entrancy guards. But I do not remember calling wxWidgets to do the guarding.
But I'll check them out to see if there are some logic violations or any use of wxWidgets recursion guards.
62
I see this issue again and again. Sometimes, the C::B just existed(crashed) without any message, this happens after when I click the "Cancel" button in the message box to continue the application. When I looked at the RPT(call stack), it just empty, so I don't have much information to share.

It is normal for crashing to happen if you click the cancel button in a wxWidgets assert style message; but it should give you a RPT file to help find the location of the crash. I have done it to track down the location where the code needs changed.

Tim S.
63
Hi,
I wrote a first unified workspace and cbp, already 4 years ago and adapted it when there was important changes in the build process of C::B (new plugins, new settings for some of them...). It's an adaptation of a previous work done by AndrewCot. It works only on Windows, just because I have not linux installed, but it should be adaptable.

Everything is available on a git (https://github.com/gerard-durand/codeblocks_gd_cbps) or a svn (https://sourceforge.net/p/codeblocks-gd-cbps/svn/HEAD/tree/) repository. See also as mentionned above https://sourceforge.net/p/codeblocks/tickets/1332/.
It uses global environment variables where you can choose the wxwidgets version, the wxWidgets 32/64 bit version, cpp_flags. The choice of 32/64 bit compiler is simply made by your general compiler setting. If you want to change something, you have only to change some global variables.
Apparently, a few guys use this build system and are happy with. Of course, as you need to set global variables, it needs some knowledge and manual setting the first time you set them. But, if you follow the "Env_vars" docs carefully, it's not so difficult.
65
Thanks, it was this timestamp thing, I was changing the date of my OS to test my program (it uses dates in some ways), some cpp files had future timestamps
66
I see the benefits from this, however, usually (at least for me) its not only the wx version that matters but also 32/64 bit and maybe a special old compiler for compatibility. For those cases it would not work unless yo very everything in the wx variable which is a bit weird. Would be great if Gerard (@gd_on) could join this conversation...

Still, it improves the situation already as it is, so I am open...
67
Development / Re: special handling of the macro replacement ""?
« Last post by Wkerry on February 21, 2026, 06:57:43 am »
Any chance of moving to a commons CBP set for each environment to save allot of file and then duplication etc when a new WxWidget version comes out.
The file in https://github.com/gerard-durand/codeblocks_gd_cbps/tree/master/src look like they have solved this for windows only.
68
I see this issue again and again. Sometimes, the C::B just existed(crashed) without any message, this happens after when I click the "Cancel" button in the message box to continue the application. When I looked at the RPT(call stack), it just empty, so I don't have much information to share.
69
Any developer has some options about this topic?

I think the recent changes in the C::B should fully support this, see discussion here:

Re: special handling of the macro replacement ""?

70
Development / Re: special handling of the macro replacement ""?
« Last post by ollydbg on February 21, 2026, 04:17:30 am »
Pages: 1 2 3 4 5 6 [7] 8 9 10