Debug C++ makefile project breakpoint not hit

Hi, 

I'm new to CLion, I've been running my code on terminal and wanted to try debugging using CLion interface. I have a custom Makefile, I already set the project as Makefile Project, edited configurations to select targets and executable, and so far I'm able to build and run my program successfully using CLion, however, I'm not able to access breakpoints on debug mode. I followed documentation example and read some posts, some recommend to link targets in a CMakefile, but I'd rather just stick with single Makefile, if possible.

The message I get is "The breakpoint will not currently be hit. No executable code is associated with this line", there's definitely something I'm missing in my configuration but I cannot find how to fix it.

I'm running CLion 2021.2.2, using Debian 10 in a Virtual Machine. Thanks in advance for the guidance.

2 comments
Comment actions Permalink

I have the same problem and I'am also on Debian 10 so maybe that's something relevant.

0
Comment actions Permalink

Turned out it was my fault. I didn't know I have to run gcc with -g flag in order to debug correctly. So for anyone having the same issue, try to compile your code like this: gcc -g source_code.c -o executable

0

Please sign in to leave a comment.