为什么我的断点在 Qt Creator 中不起作用
Qt Creator 可以完美地构建和运行我的项目,但它会直接跳过我设置的任何断点。我找不到任何选项来解决此问题,并且希望得到一些帮助。
编辑:SDK是在调试模式下构建的,并且项目构建配置设置为调试。
Qt creator can build and run my projects perfectly, but it will skip straight over any breakpoints I set. I can't find any options to fix this, and I'd appreciate some help.
EDIT: The SDK is built in debug mode, and the project build configuration is set to debug.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果这是 cmake 构建,则需要在设置项目之前设置构建类型,例如
在您的顶级 CMakeList.txt 中:
正式地,您也可以在运行 cmake 时将其传递给“项目”部分中的 cmake: http://qt -project.org/forums/viewthread/12694,因此使用 -DCMAKE_BUILD_TYPE=Debug 标志,但这似乎不再起作用......
如果您希望标志正常工作,则需要在设置项目之前对其进行测试,请参阅 http:// /www.cmake.org/pipermail/cmake/2008-September/023808.html
If this is a cmake build, you need to set the build type before setting the project, so eg
in your top CMakeList.txt:
Officially, you can pass this also to cmake in Projects section when running cmake: http://qt-project.org/forums/viewthread/12694, so with -DCMAKE_BUILD_TYPE=Debug flag, but this does not longer seem to work...
If you want a flag working, you need to test on it before setting the project, see http://www.cmake.org/pipermail/cmake/2008-September/023808.html
Qt Creator 有两种运行应用程序的模式:“运行”和“调试”。我想您可能对它们的含义感到困惑:
简而言之:当您需要在程序执行期间计算内部值和/或设置断点时,请使用调试。对于其他任何事情,只需运行它即可,这要快得多。
Qt Creator has two modes of running your app: "run" and "debug". I think you may be confused as to what they mean:
In short: when you need to figure out an internal value during program execution and/or have set breakpoints, use Debug. For anything else, just run it, which is a lot faster.
我希望这能帮助有同样问题的人。
即使我将其设置为调试模式,但输出文件也放在发布文件夹中,当我查看我的 .pro 文件时,我发现了这一行
然后我删除了“发布”,然后它就工作了。
希望这会有所帮助。
I hope this will help someone who has the same problem.
Even I set it debug mode, but the output files was put on release folder, when I looked at my .pro file, I found this line
Then I remove "release", then it worked.
Hope this will help.
您需要在 .pro 文件中添加下一行:
并且可能您需要删除此行:
You need to add in .pro file next line:
And may be you need to delete this: