这是一个非常基本的问题。我搜索了这个论坛的历史,没有发现任何直接适用于 C/C++ 中的应用程序的内容。我正在 Fedora20 上构建代码。我有以下库,使用 yum 安装:
qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel
qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel
[root@localhost subsurface]# qmake-qt5 --version
QMake version 3.0
Using Qt version 5.4.0 in /usr/lib64
我像这样使用qmake:
make-qt5
没有显示错误,我假设生成文件正常并且生成的头文件正常。
在 make 时,出现以下与 Qt 相关的错误:
[root@localhost subsurface]# make
(1)
compiling main.cpp
In file included from /usr/include/QtGui/QTextEdit:1:0,
from .uic/ui_mainwindow.h:26,
from qt-ui/mainwindow.h:14,
from main.cpp:11:
/usr/include/QtGui/qtextedit.h:235:16: error: ‘QPrinter’ has not been declared
void print(QPrinter *printer) const;
^
(2)
In file included from qt-ui/tableview.h:10:0,
from .uic/ui_diveplanner.h:26,
from qt-ui/diveplanner.h:140,
from .uic/ui_mainwindow.h:30,
from qt-ui/mainwindow.h:14,
from main.cpp:11:
.uic/ui_tableview.h: In member function ‘void Ui_TableView::retranslateUi(QGroupBox*)’:
.uic/ui_tableview.h:49:87: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
TableView->setWindowTitle(QApplication::translate("TableView", "GroupBox", 0, QApplication::UnicodeUTF8));
我怀疑我还缺少一两个 Qt 库。哪些库文件包含 QPrinter 和 UnicodeUTF8?请问有什么建议吗?亲切的问候,威廉