gpt4 book ai didi

c++ - 编译时得到错误: 'QtGui/QAction' file not found #include

转载 作者:可可西里 更新时间:2023-11-01 18:02:18 28 4
gpt4 key购买 nike

我刚刚安装了 Mac OS X 10.8.3 和 Qt Creator 3、XCode 和 XCode 命令行工具。我正在尝试编译一个在另一台计算机上运行的项目,但每次我去“全部构建”时,我都会得到 error: 'QtGui/QAction' file not found#include <QtGui/QAction>

我尝试在 .pro 文件中添加第二行和第三行,但没有帮助

QT       += core gui opengl
CONFIG += qt
QT += gui
TARGET = BasicOpenGL
TEMPLATE = app

更新:我也试过这个 .pro 文件,但它没有用

QT       += core gui opengl
QT += widgets
TARGET = BasicOpenGL
TEMPLATE = app

我应该说这是我第一次尝试在 mac 上进行开发。

从 Qt 编译输出

Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I. -F/Users/john/Qt/5.2.0/clang_64/lib -o mainwindow.o ../Framework/mainwindow.cpp
In file included from ../Framework/mainwindow.cpp:2:
../Framework/ui_mainwindow.h:14:10: fatal error: 'QtGui/QAction' file not found
#include <QtGui/QAction>
^
1 error generated.
make: *** [mainwindow.o] Error 1
15:51:32: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project BasicOpenGL (kit: Desktop Qt 5.2.0 clang 64bit)
When executing step 'Make'

更新:我让它工作了,但随着所有的麻烦,我不确定是什么导致了它。我从一个新的 mac 镜像开始,安装系统更新,安装 xcode,安装 xcode 命令行工具,安装 QT Creator 3.0,安装 QT 库 4.8.1,在 QT Creator 中设置编译器。

最佳答案

尝试执行 make clean,然后执行 make。我在 Windows 7 系统上遇到了这个问题,这对我有用。

关于c++ - 编译时得到错误: 'QtGui/QAction' file not found #include <QtGui/QAction>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21551557/

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