Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QT_DEPRECATED_SINCE gives error "missing binary operator before token (" in qnamespace.h

[SOLVED] QT_DEPRECATED_SINCE gives error "missing binary operator before token (" in qnamespace.h

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 12.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mbreier
    wrote on 4 Jun 2013, 17:42 last edited by
    #1

    Hi,

    I am currently porting a Qt application from 4.8.4 to 5.1.
    In some files I got the error message:

    missing binary operator before token "("

    in the line where the macro QT_DEPRECATED_SINCE is called.

    For example the error appears in qnamspace.h, qchar.h, qstring.h, qmetatype.h, qobject.h, qvariant.h.

    Any Ideas about this problem?

    Michael

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bjanuario
      wrote on 4 Jun 2013, 21:51 last edited by
      #2

      You should replace by: "QVariant::value()":http://qt-project.org/doc/qt-5.0/qtcore/qvariant.html#value

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbreier
        wrote on 5 Jun 2013, 10:50 last edited by
        #3

        I don't know what you mean. There is no QVariant within the Error.
        For example it appears in qnamespace.h in line 1443 with the following lines:

        #if QT_DEPRECATED_SINCE(5, 0)
        typedef WindowFlags WFlags;
        #endif

        and in qchar.h in line 360 and 367 with the following code:

        #if QT_DEPRECATED_SINCE(5, 0)
        QT_DEPRECATED inline char toAscii() const { return toLatin1(); }
        #endif

        and

        #if QT_DEPRECATED_SINCE(5, 0)
        QT_DEPRECATED static inline QChar fromAscii(char c)
        { return fromLatin1( c ); }
        #endif

        The complete error message for qnamespace.h is the following:

        In file included from ........\qt5\qtbase\include/QtCore/qnamespace.h:1:0,
        from ........\qt5\qtbase\include/QtCore/../../src/corelib/kernel/qobjectdefs.h:45,
        from ........\qt5\qtbase\include/QtCore/qobjectdefs.h:1,
        from ........\qt5\qtbase\include\QtCore/../../src/corelib/kernel/qobject.h:48,
        from ........\qt5\qtbase\include\QtCore/qobject.h:1,
        from ........\qt5\qtbase\include\QtCore/QObject:1,
        from ....\UTA-FHE2629-1100\LimitsSPS/..\ea_setup\digitalea.h:4,
        from ....\UTA-FHE2629-1100\LimitsSPS/..\ea_setup\ea_info.h:5,
        from ....\UTA-FHE2629-1100\LimitsSPS/limits.h:5,
        from c:\mingw64\bin../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stdlib.h:10,
        from c:\mingw64\bin../lib/gcc/x86_64-w64-mingw32/4.7.1/include/c++/cstdlib:66,
        from c:\mingw64\bin../lib/gcc/x86_64-w64-mingw32/4.7.1/include/c++/bits/stl_algo.h:61,
        from c:\mingw64\bin../lib/gcc/x86_64-w64-mingw32/4.7.1/include/c++/algorithm:63,
        from ........\qt5\qtbase\include/QtCore/../../src/corelib/global/qglobal.h:80,
        from ........\qt5\qtbase\include/QtCore/qglobal.h:1,
        from ........\qt5\qtbase\include/QtCore/../../src/corelib/io/qiodevice.h:45,
        from ........\qt5\qtbase\include/QtCore/qiodevice.h:1,
        from ........\qt5\qtbase\include/QtCore/../../src/corelib/io/qtextstream.h:45,
        from ........\qt5\qtbase\include/QtCore/qtextstream.h:1,
        from ........\qt5\qtbase\include/QtCore/QTextStream:1,
        from ....\UTA-FHE2629-1100\LimitsSPS\limitinfo.h:4,
        from ....\UTA-FHE2629-1100\LimitsSPS\limitinfo.cpp:1:
        ........\qt5\qtbase\include/QtCore/../../src/corelib/global/qnamespace.h:1443:24: error: missing binary operator before token "("

        so it starts with an include of the QTextStream.h

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbreier
          wrote on 5 Jun 2013, 12:02 last edited by
          #4

          I found it by myself.
          I had a header file with the name limits.h.
          The stdlib.h uses also a header file with the name limits.h. The compiler was then including the wrong limits.h from my project.

          I renamed my file to limitsval.h and then it compiles correctly.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bjanuario
            wrote on 5 Jun 2013, 13:06 last edited by
            #5

            good :D

            1 Reply Last reply
            0

            4/5

            5 Jun 2013, 12:02

            • Login

            • Login or register to search.
            4 out of 5
            • First post
              4/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved