Qt Creator中调试代码出现Unknow error弹窗

最近在Qt Creator里调试代码,发现比Clion也更人性化。特别是在编辑和调试上。但是偶尔也会出现一些小问题。

一、cmake管理的项目,每次点击开始调试就会弹出一个弹出Unknow error!

处理的方法就是删除项目下的CMakeLists.txt.user 文件。然后把项目重新打开,选择CMake Project File项目,选择CMakeLists.txt。然后点击Configuration生成项目。

二、Qt里调试出现下面报错的时候

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.

这个弹窗错误是因为选择在release下调试,设置成Debug即可!

也可以在CMakeList.txt文件里添加 

set(CMAKE_BUILD_TYPE "Debug")

或者 set(CMAKE_BUILD_TYPE Debug CACHE STRING "set build type to debug")

然后再编译调试就可以了

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Qt中使用CMake构建项目,目录下的源文件无法显示,添加下满,然后修改对应目录即可

FILE(GLOB TinyXml TinyXml/*.h)
FILE(GLOB Json Json/*.cpp Json/*.h)
FILE(GLOB Util Util/*.cpp Util/*.h)
add_custom_target(whatever SOURCES ${TinyXml} ${Json} ${Util})

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值