[英]qprinter not found in C++
這是一個非常基本的問題。 我已經搜索了該論壇的歷史,但沒有發現任何直接適用於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? 有什么建議嗎? 親切的問候,威廉
這為我在PacketSender-2.0項目上工作
# yum remove qt-devel
# yum install qt5-qtbase-devel -y
$ make clean
$ qmake-qt5
$ make
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.