qt环境问题导致的编译错误

时间:2022-10-02 21:07:16
/usr/include/qt5/QtCore/qprocess.h:245:24: error: missing binary operator before token "("

 #if QT_DEPRECATED_SINCE(5,6)

                        ^
In file included from /usr/include/qt5/QtCore/QFile:1:0,
                 from sharediskthread.h:7,
                 from linuxmenu.h:10,
                 from main.cpp:1:
/usr/include/qt5/QtCore/qfile.h:92:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5,0)
                        ^
In file included from /usr/include/qt5/QtCore/QAbstractTableModel:1:0,
                 from usbmodel.h:4,
                 from eqiupmentdialog.h:5,
                 from linuxmenu.h:12,
                 from main.cpp:1:
/usr/include/qt5/QtCore/qabstractitemmodel.h:197:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5, 0)
                        ^
In file included from /usr/include/qt5/QtCore/QAbstractTableModel:1:0,
                 from usbmodel.h:4,
                 from eqiupmentdialog.h:5,
                 from linuxmenu.h:12,
                 from main.cpp:1:
/usr/include/qt5/QtCore/qabstractitemmodel.h:306:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5,0)
                        ^
/usr/include/qt5/QtCore/qabstractitemmodel.h:321:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5,0)
                        ^
In file included from /usr/include/qt5/QtCore/QTextCodec:1:0,
                 from main.cpp:2:
/usr/include/qt5/QtCore/qtextcodec.h:65:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5, 0)
                        ^
In file included from main.cpp:7:0:
singleapplication.h:10:10: error: #include expects "FILENAME" or <FILENAME>
 #include QT_STRINGIFY(QAPPLICATION_CLASS)
          ^
In file included from /usr/include/qt5/QtCore/QDateTime:1:0,
                 from main.cpp:10: /usr/include/qt5/QtCore/qdatetime.h:89:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5,0)
                        ^ /usr/include/qt5/QtCore/qdatetime.h:289:24: error: missing binary operator before token "("
 #if QT_DEPRECATED_SINCE(5, 2)
                        ^ In file included from /usr/include/qt5/QtWidgets/qwidget.h:45:0,
                 from /usr/include/qt5/QtWidgets/QWidget:1,

问题原因:

qt4-devel与qt5.6的环境发生冲突

解决办法:

  卸载qt4-devel,  yum erase qt4-devel