Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. "Qt requires a C++11 compiler..." (WebAssembly build)

"Qt requires a C++11 compiler..." (WebAssembly build)

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 2 Posters 1.3k 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.
  • K Offline
    K Offline
    Kayote
    wrote on last edited by Kayote
    #1

    Hi I am trying to create a WebAssembly project. I have followed the steps and built Qt as described here: https://wiki.qt.io/Qt_for_WebAssembly. I tried building a newly created widget form project, and it succeeded, however now I'm trying to build the project that I have developed, which is giving me a lot of errors, the first one being:

    .....
    In file included from ..\..\..\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\include\QtCore/qcompilerdetection.h:1:
    ..\..\..\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\include\QtCore/../../src/corelib/global/qcompilerdetection.h:564:6: error: Qt requires a C++11 compiler and yours does not seem to be that.
    #    error Qt requires a C++11 compiler and yours does not seem to be that.
    

    So if that is the case, how do I enable C++11 support?

    jsulmJ 1 Reply Last reply
    0
    • K Kayote

      Hi I am trying to create a WebAssembly project. I have followed the steps and built Qt as described here: https://wiki.qt.io/Qt_for_WebAssembly. I tried building a newly created widget form project, and it succeeded, however now I'm trying to build the project that I have developed, which is giving me a lot of errors, the first one being:

      .....
      In file included from ..\..\..\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\include\QtCore/qcompilerdetection.h:1:
      ..\..\..\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\include\QtCore/../../src/corelib/global/qcompilerdetection.h:564:6: error: Qt requires a C++11 compiler and yours does not seem to be that.
      #    error Qt requires a C++11 compiler and yours does not seem to be that.
      

      So if that is the case, how do I enable C++11 support?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @kayote said in "Qt requires a C++11 compiler..." (WebAssembly build):

      So if that is the case, how do I enable C++11 support?

      In pro file add this:

      CONFIG += c++11
      

      Make sure you use a compiler which actually supports C++11.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      2
      • jsulmJ jsulm

        @kayote said in "Qt requires a C++11 compiler..." (WebAssembly build):

        So if that is the case, how do I enable C++11 support?

        In pro file add this:

        CONFIG += c++11
        

        Make sure you use a compiler which actually supports C++11.

        K Offline
        K Offline
        Kayote
        wrote on last edited by
        #3

        @jsulm
        Actually I have already added that to the .pro file, and that didn't work. When I build the project with my normal Qt MingGW installation, it works fine, but when I use the Qt 5.13 version built from source I get this error.
        Thanks for helping.

        jsulmJ 1 Reply Last reply
        0
        • K Kayote

          @jsulm
          Actually I have already added that to the .pro file, and that didn't work. When I build the project with my normal Qt MingGW installation, it works fine, but when I use the Qt 5.13 version built from source I get this error.
          Thanks for helping.

          jsulmJ Online
          jsulmJ Online
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @kayote What is the exact version of your MinGW compiler? Did you install any other MinGW in the past which is your PATH?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          K 1 Reply Last reply
          2
          • jsulmJ jsulm

            @kayote What is the exact version of your MinGW compiler? Did you install any other MinGW in the past which is your PATH?

            K Offline
            K Offline
            Kayote
            wrote on last edited by
            #5

            @jsulm
            The exact version of the compiler is MinGW 7.3.0 64-bit. There is no other versions installed, I checked my PATH and i only have "C:\Qt\Tools\mingw730_64\bin" which is the version I'm using.

            jsulmJ 1 Reply Last reply
            0
            • K Kayote

              @jsulm
              The exact version of the compiler is MinGW 7.3.0 64-bit. There is no other versions installed, I checked my PATH and i only have "C:\Qt\Tools\mingw730_64\bin" which is the version I'm using.

              jsulmJ Online
              jsulmJ Online
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @kayote This is strange.
              Try to delete the build directory, run qmake and build again.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              K 1 Reply Last reply
              1
              • jsulmJ jsulm

                @kayote This is strange.
                Try to delete the build directory, run qmake and build again.

                K Offline
                K Offline
                Kayote
                wrote on last edited by Kayote
                #7

                @jsulm
                I finally got working, somehow

                So the way I first built the project was this:

                1. cd path/to/project/with/pro/file
                2. C:\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\bin\qmake.exe && mingw32-make

                Which is the way described in the "Qt for WebAssembly" page, but then I did this instead:

                1. C:\Qt\WABuild\qt-everywhere-src-5.13.0\qtbase\bin\qmake.exe path/to/project/with/pro/file && mingw32-make.exe

                And now it works! I'm not really sure why these two are different, but at least it works.
                Thanks for the help.

                1 Reply Last reply
                0

                • Login

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