gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 04:09:50 25 4
gpt4 key购买 nike

当我在安装了 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();
}

一切正常,但是当我尝试调试此代码 (F10) 时它输出错误,缺少源文件 qtmain_win.cpp。但是,我在项目中或整个 PC 上都没有这个文件。我怎样才能摆脱这个错误?

最佳答案

不要使用 F10 开始调试,而是放置一些断点(在您需要的地方),使用 F5 开始,调试器在断点处停止后,您可以使用 F10 跳过,这样您就可以调试代码而不是 Qt 的代码。

如果你真的想调试 Qt,你还需要安装源代码(当你安装你需要的 Qt 版本时)然后你可以指向 Qt 源代码中的文件并逐步执行这些文件。

关于c++ - 不要在 Visual Studio 2012+Qt Visual Studio 加载项 1.2.1 中进行调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20933771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com