首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在C++中找不到Q打印机

在C++中找不到Q打印机
EN

Stack Overflow用户
提问于 2015-01-22 14:36:21
回答 1查看 1K关注 0票数 0

这是一个非常基本的问题。我搜索了这个论坛的历史记录,没有发现任何直接适用于这个C/C++应用程序的东西。我在Fedora20上构建代码。我使用yum安装了以下库:

代码语言:javascript
运行
复制
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:

代码语言:javascript
运行
复制
make-qt5

没有显示错误,我假设make file ok和生成的头文件都是ok的。

生成时,会出现以下与Qt相关的错误:

代码语言:javascript
运行
复制
[root@localhost subsurface]# make

(1)

代码语言:javascript
运行
复制
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)

代码语言:javascript
运行
复制
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?有什么建议吗?亲切的问候,威廉

EN

回答 1

Stack Overflow用户

发布于 2015-03-07 04:18:50

这对我在PacketSender-2.0项目中很有效

代码语言:javascript
运行
复制
# yum remove qt-devel
# yum install qt5-qtbase-devel  -y 

$ make clean
$ qmake-qt5
$ make 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28082621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档