Archive 19/01/2023.

[SOLVED] How can i debug the code in an IDE?

Kanfor

Hi again and thank you for your time.

I can compile a new project perfectly in Netbeans, but when I put a breakpoint for debug, the code not stop there. Why?

Thanks!

valera_rozuvan

Have you seen this tutorial “NetBeans IDE: Debugging C/C++ Projects Tutorial” netbeans.org/kb/docs/cnd/debugging.html ?

valera_rozuvan

Also, make sure that you compile your project with -g option, otherwise the debugger won’t be able to stop on a breakpoint.

Please see: “GCC: Options for Debugging Your Program” -> gcc.gnu.org/onlinedocs/gcc/Debu … tions.html

Kanfor

You are my hero :smiley:

If I add “-ggdb” at the end of the makefile g++ commmand, it works! :sunglasses:

[color=#0000FF]g++ -o MyGame.cpp -O3 -I$(URHO3D_INCLUDE_DIR) -I$(3RD_PARTY_INCLUDE_DIR) -L$(LIB_DIR) -lUrho3D -ggdb[/color]