How to debug standalone file in Code::Blocks?

Alaa M. picture Alaa M. · May 3, 2014 · Viewed 70.1k times · Source

I'm programming using Code::Blocks. I set some breakpoints, but Code::Blocks seems to ignore them when I run the program.

By 'start the program' I mean simply clicking build_and_run (Build and run).

I checked under Debug and saw that F8 isn't available (Start / Continue):

Debug_Menu

The program compiles and runs fine, it just ignores breakpoints. Does anybody know how to solve this?

Note: I checked here and I think the suggested answer isn't relevant for me, because in Compiler settings I have just "C:\MinGW" under Compiler's installation directory.

edit:

I'm using Windows 8 (64bit), Code::Blocks 12.11

Answer

Ciado picture Ciado · Jan 18, 2015

I guess you were trying to debug a standalone file (file not belonging to a project). Code::Blocks doesn't support debugging such files. Try including the file to be compiled as a part of an empty project or something.