gpt4 book ai didi

c++ - 编译器找不到 ui_xyz.h 文件

转载 作者:太空宇宙 更新时间:2023-11-04 11:58:49 25 4
gpt4 key购买 nike

我在 Windows7 上安装了 Netbeans 7.2 和 Qt 5。一切都编译得很好。

但最近当我创建一个 Qt 表单并尝试以这种方式使用它时:

  • 新建项目 > C/C++ Qt 应用程序 > 完成
  • 右键单击新建 Qt 项目 > 新建 > Qt 窗体 > 完成
  • 在 Designer 中保存 ui 文件后

出现此错误:

newForm.h:11:24: fatal error: ui_newForm.h: No such file or directory

main.cpp 的内容是:

#include <QGuiApplication>
#include "newForm.h"

int main(int argc, char *argv[])
{
// initialize resources, if needed
// Q_INIT_RESOURCE(resfile);

QGuiApplication app(argc, argv);

// create and show your widgets here

return app.exec();
}

我尝试手动创建 ui_xwz.h 文件并将其添加到我的项目中。但我希望它像以前一样自动工作。我该如何解决?

最佳答案

我有一个荒谬的解决方案,也许我们应该将它作为错误报告给 Netbeans 或 Qt。

enter image description here

激活项目的 QtSVG 和 QtXml 模块并重建它。我这样测试,问题消失了。

关于c++ - 编译器找不到 ui_xyz.h 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15005754/

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