Not stopped at breakpoint

I placed a breakpoint where Stephen said to and after clicking run> start debugging(F5) the code proceeded to run normally with the initwindow() showing up up. I was not stopped at the break point.

Hi Alden,

You might be running a previously built version of your code, as I’m seeing a missing semi-colon on line 13.

Hello Tuomo,

I updated the missing semi-colon(I feel dumb after missing that) and the code still does not stop at breakpoint.

Sorry I am really new to this

Just to confirm, does it stop at all? Compilers and debuggers will sometimes skip a line due to optimizations made during compilation.

No it just runs normally and the initwindow pops up for a second.

Ok, I’ve tested the code on my end and launched the program in debugging mode by pressing F5 and have been able to activate a breakpoint. This could be a problem with your C++ extension in VSCode, can you try reinstalling it?

I’ve reinstalled it and nothing changes. Just to clarify what extensions are intended to be in my project because I have. Makefile Tools, vscode-icons, and c/c++.
Screenshot 2022-11-03 180008

The only extension out of those three we need is the C/C++ extension. Just to make sure, are you starting your program in debugging mode by going to Run > Start Debugging or by pressing F5?

Run > Start Debugging

Also I tried it with F5 and removed the other two extensions and it still does not work.

Hi Tuomo, I was messing around and fixed it. The solution was that I had to .cpp projects in the explorer. Main.cpp and axegame.cpp. I copied and pasted the code from axegame.cpp to Main.cpp and it works with the breakpoint.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms