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. Error when compiling c++ project
Forum Updated to NodeBB v4.3 + New Features

Error when compiling c++ project

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 2.8k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lampvux
    wrote on 28 Jun 2018, 05:19 last edited by
    #1

    I have some problem when build project on Qt 5.8.0
    my c++ project is using Qt version mingw53_32 qmake, using cmake on https://cmake.org/, and compilers for C++ is mingw530_32 g++.exe
    but when i build project i got this error . Someone having a solution to this?
    ps : i googled for it and ppl said it's error when using c compiler for compiling c++ file but in this case i already used g++ compiler but this error still happen.
    alt text

    A 1 Reply Last reply 28 Jun 2018, 06:41
    0
    • L lampvux
      28 Jun 2018, 05:19

      I have some problem when build project on Qt 5.8.0
      my c++ project is using Qt version mingw53_32 qmake, using cmake on https://cmake.org/, and compilers for C++ is mingw530_32 g++.exe
      but when i build project i got this error . Someone having a solution to this?
      ps : i googled for it and ppl said it's error when using c compiler for compiling c++ file but in this case i already used g++ compiler but this error still happen.
      alt text

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 28 Jun 2018, 06:41 last edited by aha_1980
      #2

      @lampvux can you please show your .pro file?

      also, the Compile Output will provide more details about the problem. please show it too.

      regards

      Edit, ah CMake, so no pro file :(

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lampvux
        wrote on 28 Jun 2018, 07:24 last edited by
        #3

        this is all error from my Compile Output, just tell if you need something else

        In file included from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs.h:48:0,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobject.h:46,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/qabstractanimation.h:43,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/QtCore:5,
                         from F:\Download\New folder\webissues-client-1.1.5\webissues-client-1.1.5\src\precompiled.h:23:
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:53:7: error: unknown type name 'QMetaObject'
         const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; // defined in qobject.h (which can't be included here)
               ^
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:64:1: error: unknown type name 'namespace'
         namespace
         ^
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:68:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
         Qt {
            ^
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1753:33: error: expected ')' before ':' token
         Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons)
                                         ^
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:1: warning: data definition has no type or storage class
         class Q_CORE_EXPORT QInternal {
         ^
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:1: warning: type defaults to 'int' in declaration of 'class' [-Wimplicit-int]
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:21: error: expected ',' or ';' before 'QInternal'
         class Q_CORE_EXPORT QInternal {
                             ^
        In file included from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs.h:50:0,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobject.h:46,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/qabstractanimation.h:43,
                         from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/QtCore:5,
                         from F:\Download\New folder\webissues-client-1.1.5\webissues-client-1.1.5\src\precompiled.h:23:
        C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs_impl.h:53:23: fatal error: type_traits: No such file or directory
        compilation terminated.
        mingw32-make[2]: *** [release/precompiled.h.gch/c] Error 1
        mingw32-make[1]: *** [release] Error 2
        mingw32-make: *** [sub-src-make_first] Error 2
        Makefile.Release:11973: recipe for target 'release/precompiled.h.gch/c' failed
        mingw32-make[2]: Leaving directory 'C:/Users/tungl/Downloads/Compressed/webissues-client-1.1.5/build-webissues-Desktop_Qt_5_8_0_MinGW_32bit-Debug/src'
        Makefile:34: recipe for target 'release' failed
        mingw32-make[1]: Leaving directory 'C:/Users/tungl/Downloads/Compressed/webissues-client-1.1.5/build-webissues-Desktop_Qt_5_8_0_MinGW_32bit-Debug/src'
        Makefile:38: recipe for target 'sub-src-make_first' failed
        14:15:49: The process "C:\Qt\Qt5.8.0\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
        Error while building/deploying project webissues (kit: Desktop Qt 5.8.0 MinGW 32bit)
        When executing step "Make"
        14:15:49: Elapsed time: 01:39.
        
        A 1 Reply Last reply 28 Jun 2018, 08:18
        0
        • L lampvux
          28 Jun 2018, 07:24

          this is all error from my Compile Output, just tell if you need something else

          In file included from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs.h:48:0,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobject.h:46,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/qabstractanimation.h:43,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/QtCore:5,
                           from F:\Download\New folder\webissues-client-1.1.5\webissues-client-1.1.5\src\precompiled.h:23:
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:53:7: error: unknown type name 'QMetaObject'
           const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; // defined in qobject.h (which can't be included here)
                 ^
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:64:1: error: unknown type name 'namespace'
           namespace
           ^
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:68:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
           Qt {
              ^
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1753:33: error: expected ')' before ':' token
           Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons)
                                           ^
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:1: warning: data definition has no type or storage class
           class Q_CORE_EXPORT QInternal {
           ^
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:1: warning: type defaults to 'int' in declaration of 'class' [-Wimplicit-int]
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qnamespace.h:1778:21: error: expected ',' or ';' before 'QInternal'
           class Q_CORE_EXPORT QInternal {
                               ^
          In file included from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs.h:50:0,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobject.h:46,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/qabstractanimation.h:43,
                           from C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore/QtCore:5,
                           from F:\Download\New folder\webissues-client-1.1.5\webissues-client-1.1.5\src\precompiled.h:23:
          C:\Qt\Qt5.8.0\5.8\mingw53_32\include/QtCore/qobjectdefs_impl.h:53:23: fatal error: type_traits: No such file or directory
          compilation terminated.
          mingw32-make[2]: *** [release/precompiled.h.gch/c] Error 1
          mingw32-make[1]: *** [release] Error 2
          mingw32-make: *** [sub-src-make_first] Error 2
          Makefile.Release:11973: recipe for target 'release/precompiled.h.gch/c' failed
          mingw32-make[2]: Leaving directory 'C:/Users/tungl/Downloads/Compressed/webissues-client-1.1.5/build-webissues-Desktop_Qt_5_8_0_MinGW_32bit-Debug/src'
          Makefile:34: recipe for target 'release' failed
          mingw32-make[1]: Leaving directory 'C:/Users/tungl/Downloads/Compressed/webissues-client-1.1.5/build-webissues-Desktop_Qt_5_8_0_MinGW_32bit-Debug/src'
          Makefile:38: recipe for target 'sub-src-make_first' failed
          14:15:49: The process "C:\Qt\Qt5.8.0\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
          Error while building/deploying project webissues (kit: Desktop Qt 5.8.0 MinGW 32bit)
          When executing step "Make"
          14:15:49: Elapsed time: 01:39.
          
          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 28 Jun 2018, 08:18 last edited by
          #4

          @lampvux please post the complete Compile Output

          Qt has to stay free or it will die.

          L 1 Reply Last reply 28 Jun 2018, 10:57
          0
          • A aha_1980
            28 Jun 2018, 08:18

            @lampvux please post the complete Compile Output

            L Offline
            L Offline
            lampvux
            wrote on 28 Jun 2018, 10:57 last edited by
            #5

            @aha_1980
            here is complete compile output log :
            Compile Output log

            A 1 Reply Last reply 28 Jun 2018, 17:49
            0
            • L lampvux
              28 Jun 2018, 10:57

              @aha_1980
              here is complete compile output log :
              Compile Output log

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 28 Jun 2018, 17:49 last edited by
              #6

              @lampvux said in Error when compiling c++ project:

              @aha_1980
              here is complete compile output log :
              Compile Output log

              unaccessable for me.

              why don't you just paste it here?

              Qt has to stay free or it will die.

              L 1 Reply Last reply 29 Jun 2018, 02:29
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on 28 Jun 2018, 20:43 last edited by
                #7

                Hi,

                Is that project accessible somewhere ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                L 1 Reply Last reply 29 Jun 2018, 02:18
                0
                • SGaistS SGaist
                  28 Jun 2018, 20:43

                  Hi,

                  Is that project accessible somewhere ?

                  L Offline
                  L Offline
                  lampvux
                  wrote on 29 Jun 2018, 02:18 last edited by
                  #8

                  @SGaist
                  yes i try to build and fix something from this open source: https://github.com/mimecorg/webissues-client

                  1 Reply Last reply
                  0
                  • A aha_1980
                    28 Jun 2018, 17:49

                    @lampvux said in Error when compiling c++ project:

                    @aha_1980
                    here is complete compile output log :
                    Compile Output log

                    unaccessable for me.

                    why don't you just paste it here?

                    L Offline
                    L Offline
                    lampvux
                    wrote on 29 Jun 2018, 02:29 last edited by
                    #9

                    @aha_1980 sorry i can not upload or paste all the compile output here as the system said it's too long .
                    you can try with this link: https://drive.google.com/open?id=14bor-1lEBRDu5GTnEQJriXpXkPp0W0_U

                    A 1 Reply Last reply 29 Jun 2018, 05:35
                    0
                    • L lampvux
                      29 Jun 2018, 02:29

                      @aha_1980 sorry i can not upload or paste all the compile output here as the system said it's too long .
                      you can try with this link: https://drive.google.com/open?id=14bor-1lEBRDu5GTnEQJriXpXkPp0W0_U

                      A Offline
                      A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on 29 Jun 2018, 05:35 last edited by aha_1980
                      #10

                      @lampvux

                      hi, thanks, now I can see it - its indeed big.

                      honestly, this log looks like a mess for me. you immediately see some 'file not found' messages.

                      some files are referenced from F: but most others from C:

                      interstingly some files are indeed compiled by g++ and some by gcc - I can't say if that is a problem.

                      I'd suggest to extract this project again.

                      please use a directory without spaces ans special chars in its name.

                      maybe thats already enough.

                      Qt has to stay free or it will die.

                      L 1 Reply Last reply 29 Jun 2018, 10:37
                      4
                      • A aha_1980
                        29 Jun 2018, 05:35

                        @lampvux

                        hi, thanks, now I can see it - its indeed big.

                        honestly, this log looks like a mess for me. you immediately see some 'file not found' messages.

                        some files are referenced from F: but most others from C:

                        interstingly some files are indeed compiled by g++ and some by gcc - I can't say if that is a problem.

                        I'd suggest to extract this project again.

                        please use a directory without spaces ans special chars in its name.

                        maybe thats already enough.

                        L Offline
                        L Offline
                        lampvux
                        wrote on 29 Jun 2018, 10:37 last edited by
                        #11

                        @aha_1980
                        Thanks for your help.
                        this project work well on linux but it have problem on windows.
                        maybe your opinion about there files compiled by g++ and gcc is problem, i think about it too
                        il try something as your advice, hope it works.
                        Thanks again.

                        1 Reply Last reply
                        0

                        1/11

                        28 Jun 2018, 05:19

                        • Login

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