Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't debug in QT creator with cmake project

I created a new Plain C++ Project with CMake Build. When I set a breakpoint and press the Debug Button I get this message:

This does not seem to be a "Debug" build.
Setting breakpoints by file name and line number may fail.

Section .debug_info: Not found.
Section .debug_abbrev: Not found.
Section .debug_line: Not found.
Section .debug_str: Not found.
Section .debug_loc: Not found.
Section .debug_range: Not found.
Section .gdb_index: Not found.
Section .note.gnu.build-id: Found.
Section .gnu.hash: Found.
Section .gnu_debuglink: Not found.
like image 588
gustavgans Avatar asked Sep 14 '15 09:09

gustavgans


People also ask

How do I debug CMake project?

First, switch to CMake Targets View in the Solution Explorer window. Then, right-click on an executable and select Debug. This command automatically starts debugging the selected target based on your active configuration.


1 Answers

You can add this CMake argument to your Build Settings:

-DCMAKE_BUILD_TYPE=Debug

enter image description here

like image 164
Master Bee Avatar answered Sep 19 '22 00:09

Master Bee