QtMqtt模块“PCH文件错误”,在Centos上安装QtMqtt模块时出现问题

kninwzqo  于 2022-11-07  发布在  其他
关注(0)|答案(1)|浏览(213)

当我尝试在centos上安装qt mqtt模块时,我遇到了PCH问题。我正在执行下面的步骤。但是当我运行make语句时,我遇到了这个问题。问题是PCH文件。我遇到的错误输出如下。提前感谢那些帮助我的人。

[oozturk@dev-host-06 qtmqtt]$ egrep '^(VERSION|NAME)=' /etc/os-release 
NAME="CentOS Linux"
VERSION="8"

[oozturk@dev-host-06 Downloads]$ git clone -b 5.15.2 http://github.com/qt/qtmqtt.git
Cloning into 'qtmqtt'...
...

[oozturk@dev-host-06 Downloads]$ cd qtmqtt/
[oozturk@dev-host-06 qtmqtt]$ ls
dist  examples  LICENSE.GPL3  LICENSE.GPL3-EXCEPT  qtmqtt.pro  src  sync.profile  tests
[oozturk@dev-host-06 qtmqtt]$ /home/oozturk/Qt/5.15.2/gcc_64/bin/qmake
Info: creating stash file /home/oozturk/Downloads/qtmqtt/.qmake.stash
Info: creating cache file /home/oozturk/Downloads/qtmqtt/.qmake.cache
[oozturk@dev-host-06 qtmqtt]$ 
[oozturk@dev-host-06 qtmqtt]$ make
cd src/ && ( test -e Makefile || /home/oozturk/Qt/5.15.2/gcc_64/bin/qmake -o Makefile /home/oozturk/Downloads/qtmqtt/src/src.pro ) && make -f Makefile 
make[1]: Entering directory '/home/oozturk/Downloads/qtmqtt/src'
cd mqtt/ && ( test -e Makefile || /home/oozturk/Qt/5.15.2/gcc_64/bin/qmake -o Makefile /home/oozturk/Downloads/qtmqtt/src/mqtt/mqtt.pro ) && make -f Makefile 
Project MESSAGE: perl -w /home/oozturk/Qt/5.15.2/gcc_64/bin/syncqt.pl -module QtMqtt -version 5.15.2 -outdir /home/oozturk/Downloads/qtmqtt -builddir /home/oozturk/Downloads/qtmqtt /home/oozturk/Downloads/qtmqtt
<srcbase> = /home/oozturk/Downloads/qtmqtt 
<bldbase> = /home/oozturk/Downloads/qtmqtt 
<outbase> = /home/oozturk/Downloads/qtmqtt 
QtMqtt: created fwd-include header(s) for <srcbase>/src/mqtt/ { qmqttauthenticationproperties.h (2), qmqttclient.h (2), qmqttclient_p.h (1), qmqttconnection_p.h (1), qmqttconnectionproperties.h (4), qmqttconnectionproperties_p.h (1), qmqttcontrolpacket_p.h (1), qmqttglobal.h (1), qmqttmessage.h (2), qmqttmessage_p.h (1), qmqttpublishproperties.h (3), qmqttpublishproperties_p.h (1), qmqttsubscription.h (2), qmqttsubscription_p.h (1), qmqttsubscriptionproperties.h (3), qmqtttopicfilter.h (2), qmqtttopicname.h (2), qmqtttype.h (3) }
QtMqtt: created version header
QtMqtt: created master header
QtMqtt: created headers.pri file
make[2]: Entering directory '/home/oozturk/Downloads/qtmqtt/src/mqtt'
perl /home/oozturk/Qt/5.15.2/gcc_64/mkspecs/features/data/unix/findclasslist.pl < QtMqtt.version.in > QtMqtt.version
g++ -pipe -O2 -g -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wextra -Wvla -Wdate-time -D_REENTRANT -fPIC -DQT_NO_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_LINKED_LIST -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_MQTT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../include -I../../include/QtMqtt -I../../include/QtMqtt/5.15.2 -I../../include/QtMqtt/5.15.2/QtMqtt -I/home/oozturk/Qt/5.15.2/gcc_64/include -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtNetwork -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore/5.15.2 -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore/5.15.2/QtCore -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore -I.moc -I/home/qt/openssl-1.1.1g/include -I/home/oozturk/Qt/5.15.2/gcc_64/mkspecs/linux-g++ -x c++-header -c ../../include/QtMqtt/QtMqttDepends -o .pch/Qt5Mqtt.gch/c++
g++ -c -include .pch/Qt5Mqtt -pipe -O2 -g -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wextra -Wvla -Wdate-time -D_REENTRANT -fPIC -DQT_NO_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_LINKED_LIST -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_MQTT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../include -I../../include/QtMqtt -I../../include/QtMqtt/5.15.2 -I../../include/QtMqtt/5.15.2/QtMqtt -I/home/oozturk/Qt/5.15.2/gcc_64/include -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtNetwork -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore/5.15.2 -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore/5.15.2/QtCore -I/home/oozturk/Qt/5.15.2/gcc_64/include/QtCore -I.moc -I/home/qt/openssl-1.1.1g/include -I/home/oozturk/Qt/5.15.2/gcc_64/mkspecs/linux-g++ -o .obj/qmqttauthenticationproperties.o qmqttauthenticationproperties.cpp
cc1plus: error: one or more PCH files were found, but they were invalid
cc1plus: error: use -Winvalid-pch for more information
cc1plus: fatal error: .pch/Qt5Mqtt: No such file or directory
compilation terminated.
make[2]:***[Makefile:1726: .obj/qmqttauthenticationproperties.o] Error 1
make[2]: Leaving directory '/home/oozturk/Downloads/qtmqtt/src/mqtt'
make[1]:***[Makefile:47: sub-mqtt-make_first] Error 2
make[1]: Leaving directory '/home/oozturk/Downloads/qtmqtt/src'
make:***[Makefile:49: sub-src-make_first] Error 2
de90aj5v

de90aj5v1#

已解决。问题是文件Qt 5 Mqtt没有创建。我看到当我在../qtmqtt/src/mqtt/.pch路径上手动创建Qt 5 Mqtt文件时,问题已解决。我通过运行测试代码进行了测试。

[oozturk@dev-host-06 .pch]# pwd
/home/oozturk/Desktop/Projects/qtmqtt/src/mqtt/.pch
[oozturk@dev-host-06 .pch]# touch Qt5Mqtt

相关问题