Qt标准项目和示例停止构建
Qt standard project and examples stopped building
Qt项目突然停止建设。因此,as new只是基于QDialog或示例创建了空项目。清洁、重建没有帮助。
关键错误日志:
/Users/dmitrytolstov/Workspace/Qt521/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qdialog.h:117:
error: unknown type name 'QDialog'
Q_DISABLE_COPY(QDialog)
/Users/dmitrytolstov/Workspace/Qt521/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qdialog.h:117:
error: C++ requires a type specifier for all declarations
Q_DISABLE_COPY(QDialog)
/Users/dmitrytolstov/Workspace/Qt521/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qdialog.h:117:
error: unknown type name 'QDialog'
/Users/dmitrytolstov/Workspace/CC++/QtStuff/NewDiaproj/dialog.h:10:
error: unknown class name 'QDialog'; did you mean 'Dialog'?
class Dialog : public QDialog
/Users/dmitrytolstov/Workspace/CC++/QtStuff/NewDiaproj/dialog.h:10:
error: base class has incomplete type
class Dialog : public QDialog
/Users/dmitrytolstov/Workspace/CC++/QtStuff/NewDiaproj/main.cpp:8:
error: no member named 'show' in 'Dialog'
w.show();
7 errors generated.
make: *** [main.o] Error 1
18:46:36: Process «/usr/bin/make» exit with code 2.
qdialog.h好像出了什么事。顺便说一句,QMainWindow上的项目运行良好。我什么都没做。尝试重新打开QtCreator,重新启动计算机。我使用Mac OS X和Qt 5.2.1
QtCreator提供的任何示例或基于QDialog的空项目。例如:对话框.cpp:
#include "dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent)
{
}
Dialog::~Dialog()
{
}
对话框.h
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
class Dialog : public QDialog
{
Q_OBJECT
public:
explicit Dialog(QWidget *parent = 0);
~Dialog();
};
#endif // DIALOG_H
main.cpp
#include "dialog.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.show();
return a.exec();
}
NewDiaproj.pro
#-------------------------------------------------
#
# Project created by QtCreator 2014-04-20T19:31:45
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = NewDiaproj
TEMPLATE = app
SOURCES += main.cpp
dialog.cpp
HEADERS += dialog.h
基于您的文件在带有Qt 5.2的Archlinux上运行良好的事实,我认为您在Qt安装中的QDialog
文件因某些意外或"vis-mail"操作而损坏。
干净地重新安装它,然后它就可以正常工作了。
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- 无法在 CLion 中构建 C++ 项目
- 函数向量_指针有不同的原型,我可以构建一个吗
- 如何使用ndk-build.cmd构建Android.so文件
- 使用CMake检测支持的C++标准
- 如何理解C++标准N3337中的expr.const.cast子句8
- "throw expression code" 1e7 >返回 d 是什么?投掷标准::overflow_error( "too big" ) : d;意味 着?
- 编译标准库类型
- 尝试将Winelib与标准macOS构建工具一起使用:得到奇怪的编译器错误
- 酿造警告:依赖关系是使用不同的C 标准库构建的
- 无法在 cpp 文件中通过可视化标准输出构建 yuvlib 库函数
- 如何编辑和重新构建GCC libstdc++C++标准库源代码
- RIOS X Mavericks上使用clang++构建的内部示例在链接上找不到STL标准库
- 我可以用标准库组件构建这个特殊的舍入函数吗
- 如何引入标准库的意外构建依赖项
- 在VS中构建和运行C++标准"主"条目的控制台应用程序(2010)
- 构建图的最佳标准数据结构是什么?
- Qt标准项目和示例停止构建
- Mingw构建具有最新标准支持
- 使用静态标准库构建可视化C++静态库