skunkforce / OmniView

This Repository contains the OmniView Software, which is used in the AW4null Research Projects
https://www.autowerkstatt40.org/
MIT License
3 stars 4 forks source link

Compiling in Debug mode #89

Closed R-Abbasi closed 1 month ago

R-Abbasi commented 4 months ago

Since Ubuntu 23 failed to work properly with the project, I had to switch back to 22 and installed the current LTS version 22.04.3. It didn't work properly with the project either (but later on, after installing the packages mentioned in the README file, Ubuntu 22.04.3 seemed to work appropriately with the project - I guess 23 will work that way too), hence had no choice except going for Windows. Compiled the project and ran it there. cmake seemingly uses msvc by default on Windows, even though gcc was installed as well. By clicking on the Diagnostics menu button, the program crashed. When debugging, the error found was: Assertion failed: SizeOfColorStack >= g.ColorStack.Size && "PushStyleColor/PopStyleColor Mismatch!" this line. This problem doesn't happen on Ubuntu (gcc ignores that?), so probably it has existed from long time ago.
When reviewing the code in main.cpp, 6 pushs were counted against 5 pops for that situation, which revealed the source of the mismatch. Increasing the first ImGui::PopStyleColor(); in that menu button's code to 2 (ImGui::PopStyleColor(2);) fixed the problem.

The point here could be considering using mcvs and Debug mode, apart from gcc, during development time.