简体   繁体   English

不要在Visual Studio 2012 + Qt Visual Studio加载项1.2.1中进行调试

[英]Don't work debugging in Visual Studio 2012+Qt Visual Studio add-in 1.2.1

When i run(F5) following code in Visual Studio 2012 with installed QT Visual Studio add-in 1.2.1 当我在安装了QT Visual Studio加载项1.2.1的Visual Studio 2012中运行(F5)以下代码时

#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QLabel lbl("Hello");
    lbl.show();
    return a.exec();
}

everything works fine, but when I try to debug this code(F10) it outputs error, that there is missed source file qtmain_win.cpp . 一切正常,但是当我尝试调试此代码(F10)时,它输出错误,表明缺少源文件qtmain_win.cpp However I don't have this file in project or overall on PC. 但是我在项目中或PC上没有此文件。 How can I rid off from this error? 如何摆脱这个错误?

Instead of starting the debug with F10 , put some break-points (where you need them), start with F5 and after the debugger stops at break-points you can step-over with F10 and this way you debug your code and not Qt's code. 而不是使用F10开始调试,而是放置一些断点(需要它们的地方),从F5开始,在调试器停止在断点之后,您可以使用F10进行过渡,这样您可以调试代码而不是Qt的代码。

If you really want to debug Qt, you need to install the source code too (when you install the Qt version you need) and then you can point to the files from Qt's source code and step trough those too. 如果您真的想调试Qt,则也需要安装源代码(安装所需的Qt版本时),然后可以指向Qt源代码中的文件,并逐个遍历。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM