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

gus*_*ans 7 cmake qt-creator

我用CMake Build创建了一个新的Plain 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.
Run Code Online (Sandbox Code Playgroud)

Mas*_*Bee 6

您可以将此CMake参数添加到构建设置:

-DCMAKE_BUILD_TYPE=Debug
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

  • 在QtCreator 3.5中,CMake参数仅在重建CMake生成的makefile时可用 - 它是一个单独的弹出窗口,而不是Build Settings下的表单. (2认同)