这是一个非常基本的问题。我搜索了这个论坛的历史记录,没有发现任何直接适用于这个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 file ok和生成的头文件都是ok的。
生成时,会出现以下与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?有什么建议吗?亲切的问候,威廉
发布于 2015-03-07 04:18:50
这对我在PacketSender-2.0项目中很有效
# yum remove qt-devel
# yum install qt5-qtbase-devel -y
$ make clean
$ qmake-qt5
$ make
https://stackoverflow.com/questions/28082621
复制相似问题