RaspberryPi 上的 Qt - QXmlAttributes 隐式声明

Posted

技术标签:

【中文标题】RaspberryPi 上的 Qt - QXmlAttributes 隐式声明【英文标题】:Qt on RaspberryPi - QXmlAttributes implicit declaration 【发布时间】:2016-12-15 09:19:42 【问题描述】:

我正在按照本指南https://wiki.qt.io/Raspberry_Pi_Beginners_Guide 使用主机桌面在 RaspberryPi 上构建 Qt。

在使用make 命令构建 Qt 时,我遇到了一个奇怪的错误:

In file included from ../../include/QtXml/qxml.h:1:0,
         from dom/qdom.cpp:54:
../../include/QtXml/../../src/xml/sax/qxml.h:121:5: error: function ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’
Makefile:1338: recipe for target '.obj/qdom.o' failed
make[2]: *** [.obj/qdom.o] Error 1
make[2]: Leaving directory '/home/anon/opt/qt5/qtbase/src/xml'
Makefile:295: recipe for target 'sub-xml-make_first' failed
make[1]: *** [sub-xml-make_first] Error 2
make[1]: Leaving directory '/home/anon/opt/qt5/qtbase/src'
Makefile:46: recipe for target 'sub-src-make_first' failed
make: *** [sub-src-make_first] Error 2

一些规格: 主机 - Debian Jessie RPI - Raspbian

我现在该怎么办?从头开始重新安装没有任何效果。

【问题讨论】:

【参考方案1】:

第一个错误显然是由“QXmlAttributes::QXmlAttributes(QXmlAttributes&&)”声明中的冲突引起的

我遇到了同样的错误:function 'QXmlAttributes::QXmlAttributes(QXmlAttributes&&)' 默认在其第一个声明中使用与隐式声明 'QXmlAttributes::QXmlAttributes(QXmlAttributes&&)' 不同的异常规范

我通过以下链接的建议设法解决了这个问题:Cross compiling for Raspberry Error

解决办法是改变:

1.打开/qt5/qtbase/src/xml/sax/qxml.h文件

2.更改:“QXmlAttributes(QXmlAttributes &&) Q_DECL_NOTHROW = default”

“QXmlAttributes(QXmlAttributes &&) = default”

希望这会有所帮助!

【讨论】:

以上是关于RaspberryPi 上的 Qt - QXmlAttributes 隐式声明的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 QT 在 Raspberry Pi 上的 LCD 和 HDMI 上同时在 Linux 中绘制图像?

我们如何在 Qt 工具包(Qt)应用程序中读取已安装(Raspberry pi)usb 中的所有 mp3 文件

在 Raspberry 上编译 Qt5 应用程序

树梅派硬件编程_QT_OLED显示字符

无法从 qt5.6 源代码为 raspberry pi 2 构建 qtwebengine

Raspberry Pi 上带有 Tslib 的 Qt 5.4 Linux 触摸屏输入因 LinuxFB QPA 平台插件而失败