econsysqtcam/qtcam

missing binary operator

Closed this issue · 6 comments

After I runned qmake-qt5 I runned make and I got many errors messages that i attach here

    g++ -c -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -O2 -Wall -W -D__STDC_CONSTANT_MACROS -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Iqtquick2applicationviewer -Iv4l2headers/include -isystem /usr/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o main.o main.cpp
    In file included from /usr/include/qt5/QtWidgets/QApplication:1:0,
                     from main.cpp:21:
    /usr/include/qt5/QtWidgets/qapplication.h:100:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 0)
                            ^
    /usr/include/qt5/QtWidgets/qapplication.h:136:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 0)
                            ^
    /usr/include/qt5/QtWidgets/qapplication.h:166:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 0)
                            ^
    In file included from /usr/include/qt5/QtCore/QDateTime:1:0,
                     from main.cpp:24:
    /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:286:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 2)
                            ^
    In file included from /usr/include/qt5/QtGui/QIcon:1:0,
                     from main.cpp:26:
    /usr/include/qt5/QtGui/qicon.h:95:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 0)
                            ^
    In file included from /usr/include/qt5/QtCore/QStandardPaths:1:0,
                     from main.cpp:27:
    /usr/include/qt5/QtCore/qstandardpaths.h:88:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 2)
                            ^
    In file included from /usr/include/qt5/QtGui/qsurface.h:38:0,
                     from /usr/include/qt5/QtGui/qwindow.h:44,
                     from /usr/include/qt5/QtQuick/qquickwindow.h:40,
                     from /usr/include/qt5/QtQuick/qquickview.h:37,
                     from /usr/include/qt5/QtQuick/QQuickView:1,
                     from qtquick2applicationviewer/qtquick2applicationviewer.h:14,
                     from main.cpp:28:
    /usr/include/qt5/QtGui/qsurfaceformat.h:123:24: error: missing binary operator before token "("
     #if QT_DEPRECATED_SINCE(5, 2)

Hi Germano,
Qtcam source is build tested with Qt5.2.1, may i know what is the version of Qt library are you using.
I also had a quick search on this bug,
GoldenCheetah/GoldenCheetah#1508

On some further investigation, your system may have qt4 and qt5 headers installed on the same machine. The qt4 headers live in /usr/include/QtWidgets/... and the qt5 headers live in /usr/include/qt5/QtWidgets/... The -isystem /usr/include appears before -isystem /usr/include/qt5 in the g++ arguments. Since the source[In main.cpp] includes <QtWidgets/QApplication> means the first matching include is /usr/include/QtWidgets/... which doesn't define QT_DEPRECATED_SINCE.
Solution we can try out:

  1. Uninstall qt4-headers.
    (or)
  2. Edit qtcam.pro file to add following lines,
    INCLUDEPATH += /usr/include/qt5/QtWidgets
    += /usr/include/qt5/QtCore
    += /usr/include/qt5/QtGui

Hi Germano,
Does the above solution works out?

Hi, I am going to test it in next hours. Thank you very much

Ok #4 (comment) fixes the problem

Hi !
I have the same trouble, but I don't find the file qtcam.pro.
Where is the file?
TY