1. 程式人生 > >usr/include/c++/6.4.1/bits/stl_relops.:67: Parse error at "std"

usr/include/c++/6.4.1/bits/stl_relops.:67: Parse error at "std"

table finish style obs updating func pro text sin

問題描述:

1.編譯某qt工程的32位架構二進制包時,出現了上面錯誤,具體錯誤信息如下

qmake-qt5 -o ProductLicense/Makefile ProductLicense/ProductLicense.pro CONFIG+=debug
Scanning directory /builddir/build/BUILD/anaconda-26.48.21/welcome-src/ProductLicense...
Updating productlicense_cn.ts...
    Found 7 source text(s) (0 new and 7 already existing)
Scanning directory 
/builddir/build/BUILD/anaconda-26.48.21/welcome-src/ProductLicense... Updating productlicense_en.ts... Found 7 source text(s) (0 new and 7 already existing) Updating productlicense_cn.qm... Generated 5 translation(s) (5 finished and 0 unfinished) Ignored 2 untranslated source text(s) Updating
productlicense_en.qm... Generated 5 translation(s) (5 finished and 0 unfinished) Ignored 2 untranslated source text(s) /usr/bin/make -C ProductLicense make[3]: Entering directory /builddir/build/BUILD/anaconda-26.48.21/welcome-src/ProductLicense /usr/lib/qt5/bin/uic productlicense.ui -o ui_productlicense.h g
++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib/qt5/mkspecs/linux-g++ -o main.o main.cpp /usr/lib/qt5/bin/rcc -name license license.qrc -o qrc_license.cpp g++ -pipe -g -Wall -W -dM -E -o moc_predefs.h /usr/lib/qt5/mkspecs/features/data/dummy.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib/qt5/mkspecs/linux-g++ -o productlicense.o productlicense.cpp /usr/lib/qt5/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/usr/lib/qt5/mkspecs/linux-g++ -I/builddir/build/BUILD/anaconda-26.48.21/welcome-src/ProductLicense -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I/usr/include/c++/6.4.1 -I/usr/include/c++/6.4.1/x86_64-redhat-linux -I/usr/include/c++/6.4.1/backward -I/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include -I/usr/local/include -I/usr/include productlicense.h -o moc_productlicense.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib/qt5/mkspecs/linux-g++ -o qrc_license.o qrc_license.cpp welcome.c: In function main: welcome.c:37:45: warning: passing argument 2 of g_timeout_add_seconds from incompatible pointer type [-Wincompatible-pointer-types] g_timeout_add_seconds(AUTOEXIT_TIMEOUT, gtk_main_quit, NULL); ^~~~~~~~~~~~~ In file included from /usr/include/glib-2.0/glib/giochannel.h:33:0, from /usr/include/glib-2.0/glib.h:54, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from welcome.c:1: /usr/include/glib-2.0/glib/gmain.h:581:10: note: expected GSourceFunc {aka int (*)(void *)} but argument is of type void (*)(void) guint g_timeout_add_seconds (guint interval, ^~~~~~~~~~~~~~~~~~~~~ usr/include/c++/6.4.1/bits/stl_relops.:67: Parse error at "std" Makefile:333: recipe for target moc_productlicense.cpp failed make[3]: *** [moc_productlicense.cpp] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory /builddir/build/BUILD/anaconda-26.48.21/welcome-src/ProductLicense Makefile:6: recipe for target system_install failed make[2]: Leaving directory /builddir/build/BUILD/anaconda-26.48.21/welcome-src make[2]: *** [system_install] Error 2 Makefile:542: recipe for target all-recursive failed make[1]: Leaving directory /builddir/build/BUILD/anaconda-26.48.21 make[1]: *** [all-recursive] Error 1 Makefile:436: recipe for target all failed

但是編譯64位架構的rpm包時並沒有報錯,網上查詢了標題bug相關信息,https://forum.qt.io/topic/56552/solved-pi2-qt5-4-1-std-errors-configure-errors

說是將qt從5.4.1升級到5.4.2即可解決,查看我版本機中32位mock環境的qt版本,發現已經是5.7;

技術分享圖片

想起該工程的上一次gerrit提交jenkins可以正常編譯通過的,包括64位和32架構的二進制包,對比兩次提交的文件差異,發現這次提交增加了兩個qt相關中間文件,

ProductLicense.pro.user.82c30c7

.qmake.stash

去除這兩個文件後32位mock編譯正常,真正原因因時間所限制,後面空了再深究。

usr/include/c++/6.4.1/bits/stl_relops.:67: Parse error at "std"