Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Missing binary operator before token "("

    Installation and Deployment
    2
    2
    1943
    Loading More Posts
    • 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.
    • B
      Bacon last edited by Bacon

      Alt-title: a series of unfortunate events.

      Hello, I'm new here, please be gentle with the programming vernacular.

      Info:
      Linux, ubuntu 18.04
      Qt version 5.13.0
      now: Qt-5.12.0
      Qt creator version: 4.9.3(not sure, uninstalled this)
      now: Qt creator version 4.8.0
      Qmake 3.1

      Basically, I wrote a program using qt creator. The kit I used was autodetected: "Desktop Qt 5.13.0 GCC 64bit"

      On trying to release my program, I searched for ways to convert it into an appimage. I came across "linuxdeployqt". However, linuxdeployqt could not find Qt-5.13.0. I will not go into detail, but I decided to port my program to Qt5.12.0.

      I downloaded 5.12.0's online installer. After installing, the auto-detected kit "Desktop Qt 5.12.0 GCC 64bit" popped up in my kit manager. So I reconfigured my project to run on that kit, and I was met with 700+ error messages, of which a large portion were 'Missing binary operator before token "("'

      https://forum.qt.io/topic/27925/solved-qt_deprecated_since-gives-error-missing-binary-operator-before-token-in-qnamespace-h
      This forum does not help me, because I tried starting a new project in qt creator:
      file->new file/project->application->qt quick application - empty
      And the same issue occured. The problem identified in the forum was that a header file name conflicted with some other system stuff. This would be impossible on a fresh project with nothing in it(and no header files, for that matter)

      https://stackoverflow.com/questions/21338385/what-does-the-compiler-error-missing-binary-operator-before-token-mean
      This doesn't help me either. Something to do with incorrect syntax in preprocessor commands. Doesn't help me, I've never even touched that stuff.

      I tried uninstalling qt5.13 and 5.12 using the maintenance tool for each. Upon reinstalling qt5.12 using the online installer, and starting a fresh project, the same error occurs.

      I checked my kit manager, and confirmed that the kit was using qmake located in my installed qt5.12.0/5.12.0/lib/ folder.

      I don't really know whats going wrong, I'm guessing it isn't related to my own program, since fresh projects have the same problem. Any help appreciated

      Fresh project I created to test:
      "qt12test"
      -qt12test.pro
      -qt12test.pro.user
      -main.cpp
      -main.qml
      -qml.qrc

      Error message I got from running this fresh project using Qt5.12.0 kit:

      In file included from /usr/include/features.h:365:0,
                       from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
                       from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
                       from /usr/include/c++/7/type_traits:38,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qglobal.h:45,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qatomic.h:41,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qrefcount.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/x86_64-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
       #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                       ^
      In file included from /usr/include/c++/7/cstdlib:75:0,
                       from /usr/include/c++/7/bits/stl_algo.h:59,
                       from /usr/include/c++/7/algorithm:62,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qglobal.h:142,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qatomic.h:41,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qrefcount.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/stdlib.h:133:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:139:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:145:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:151:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:157:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:163:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:169:37: error: missing binary operator before token "("
       #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                           ^
      /usr/include/stdlib.h:211:17: error: missing binary operator before token "("
       #if __GLIBC_USE (IEC_60559_BFP_EXT)
                       ^
      /usr/include/stdlib.h:225:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:231:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:237:35: error: missing binary operator before token "("
       #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                         ^
      /usr/include/stdlib.h:243:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:249:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:255:36: error: missing binary operator before token "("
       #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                          ^
      /usr/include/stdlib.h:261:37: error: missing binary operator before token "("
       #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                           ^
      In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:0,
                       from /usr/include/c++/7/bits/atomic_base.h:36,
                       from /usr/include/c++/7/atomic:41,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qatomic_cxx11.h:45,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbasicatomic.h:53,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qatomic.h:46,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qglobal.h:1204,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qatomic.h:41,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qrefcount.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/stdint.h:286:17: error: missing binary operator before token "("
       #if __GLIBC_USE (IEC_60559_BFP_EXT)
                       ^
      In file included from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qarraydata.h:44:0,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:46,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/string.h:164:21: error: missing binary operator before token "("
            || __GLIBC_USE (LIB_EXT2))
                           ^
      /usr/include/string.h:173:43: error: missing binary operator before token "("
       #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                                 ^
      In file included from /usr/include/c++/7/cwchar:44:0,
                       from /usr/include/c++/7/bits/postypes.h:40,
                       from /usr/include/c++/7/bits/char_traits.h:40,
                       from /usr/include/c++/7/string:40,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:52,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/wchar.h:564:43: error: missing binary operator before token "("
       #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                                 ^
      In file included from /usr/include/c++/7/cstdio:42:0,
                       from /usr/include/c++/7/ext/string_conversions.h:43,
                       from /usr/include/c++/7/bits/basic_string.h:6361,
                       from /usr/include/c++/7/string:52,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:52,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/stdio.h:276:43: error: missing binary operator before token "("
       #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                                 ^
      /usr/include/stdio.h:349:17: error: missing binary operator before token "("
       #if __GLIBC_USE (LIB_EXT2)
                       ^
      /usr/include/stdio.h:567:17: error: missing binary operator before token "("
       #if __GLIBC_USE (DEPRECATED_GETS)
                       ^
      /usr/include/stdio.h:592:43: error: missing binary operator before token "("
       #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                                 ^
      In file included from /usr/include/c++/7/ext/string_conversions.h:43:0,
                       from /usr/include/c++/7/bits/basic_string.h:6361,
                       from /usr/include/c++/7/string:52,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qbytearray.h:52,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtCore/qurl.h:44,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlengine.h:43,
                       from ../../Qt5.12.0/5.12.0/gcc_64/include/QtQml/qqmlapplicationengine.h:43,
                       from ../qt12test/main.cpp:1:
      /usr/include/c++/7/cstdio:124:11: error: ‘::gets’ has not been declared
         using ::gets;
                 ^~~~
      Makefile:816: recipe for target 'main.o' failed
      make: *** [main.o] Error 1
      12:06:13: The process "/usr/bin/make" exited with code 2.
      Error while building/deploying project qt12test (kit: Desktop Qt 5.12.0 GCC 64bit)
      When executing step "Make"
      
      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @Bacon last edited by JonB

        @Bacon
        I don't have an answer for you, but looking at your SO reference page it seems awfully like what is reported in https://stackoverflow.com/a/53566303/489865 ?

        Do you have your own source file named features.h? Can you make your compilation show the commands it is issuing, do you use the gcc's -I option?

        1 Reply Last reply Reply Quote 1
        • First post
          Last post