无法在QT创建者中使用CMake项目进行调试

8
我使用CMake Build创建了一个新的纯C++项目。当我设置断点并按下调试按钮时,会出现以下消息:
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.
1个回答

10

你可以在构建设置中添加此CMake参数

-DCMAKE_BUILD_TYPE=Debug

enter image description here


1
我可以在哪里找到这个? - gustavgans
为了澄清,我添加了一张截图。 - Master Bee
这似乎不起作用,即使使用此设置仍然是发布类型。 - Petr
2
在QtCreator 3.5中,只有当重新构建CMake生成的makefile时才可以使用CMake参数 - 它是一个单独的弹出窗口,而不是Build Settings下面的表单。 - JustAMartin

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接