Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Independent Developers
  4. error Qt requires C++11 support
Forum Updated to NodeBB v4.3 + New Features

error Qt requires C++11 support

Scheduled Pinned Locked Moved Solved Independent Developers
9 Posts 4 Posters 7.7k Views 2 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.
  • M Offline
    M Offline
    MarkS1955
    wrote on last edited by
    #1

    Hi,
    I am becoming rather frustrated with this problem. There seems to be a history of it, I've tried pretty much all of the recommended solutions, but it persists. I cannot create any new projects, nor compile the Qt Src, examples, etc.

    I am running RHEL 7.7 Server, which includes GCC 4.8, which provides c++11 support. I am trying to use Qt 5.14.2. I've run configure as described in the Src/README. Output of configure says I have c++11 support. I added "CONFIG += c++11" to qt.pro in Src. My make output shows "-std=gnu++11". So, I am asking why this problem is happening?

    Thanks

    jsulmJ 1 Reply Last reply
    0
    • M MarkS1955

      Hi,
      I am becoming rather frustrated with this problem. There seems to be a history of it, I've tried pretty much all of the recommended solutions, but it persists. I cannot create any new projects, nor compile the Qt Src, examples, etc.

      I am running RHEL 7.7 Server, which includes GCC 4.8, which provides c++11 support. I am trying to use Qt 5.14.2. I've run configure as described in the Src/README. Output of configure says I have c++11 support. I added "CONFIG += c++11" to qt.pro in Src. My make output shows "-std=gnu++11". So, I am asking why this problem is happening?

      Thanks

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

      @MarkS1955 said in error Qt requires C++11 support:

      GCC 4.8

      Take a look at https://gcc.gnu.org/projects/cxx-status.html
      "GCC 4.8.1 was the first feature-complete implementation of the 2011 C++ standard"
      So, not sure GCC 4.8 is really enough.

      "nor compile the Qt Src" - what errors do you get? Are they actually related to C++11 support?

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

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @MarkS1955 said in error Qt requires C++11 support:

        GCC 4.8

        Take a look at https://gcc.gnu.org/projects/cxx-status.html
        "GCC 4.8.1 was the first feature-complete implementation of the 2011 C++ standard"
        So, not sure GCC 4.8 is really enough.

        "nor compile the Qt Src" - what errors do you get? Are they actually related to C++11 support?

        M Offline
        M Offline
        MarkS1955
        wrote on last edited by
        #3

        @jsulm Thanks for the reply. I am currently trying to go above GCC 5.0 to see if that will fix it. Kind of seems like it has to be something like that. Here is a sample of the compiler error
        In file included from ../../include/QtCore/qbasicatomic.h:1:0
        from ../../include/QtCore/../../src/corelib/thread/qatomic.h:46,
        from ../../include/QtCore/qatomic.h:1,
        from global/qglobal.h:130
        from global/qt_pch.h:56../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:61:4
        #error "Qt requires C++11 support"
        #error "Qt requires C++11 support"

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MarkS1955
          wrote on last edited by
          #4

          Update to this post, I am actually using GCC 4.8.5, which should contain all the c++11 features. Again, this problem is rather bizarre.

          JonBJ 1 Reply Last reply
          0
          • M MarkS1955

            Update to this post, I am actually using GCC 4.8.5, which should contain all the c++11 features. Again, this problem is rather bizarre.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @MarkS1955
            For the record, from your qbasicatomic.h:61:4 error message you are falling foul in this code:

            // If C++11 atomics are supported, use them!
            // Note that constexpr support is sometimes disabled in QNX builds but its
            // library has <atomic>.
            #elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX))
            #  include <QtCore/qatomic_cxx11.h>
            ...
            
            // No fallback
            #else
            #  error "Qt requires C++11 support"
            #endif
            

            so it appears to be your lack of constexpr support. Not that I know there's anything you can do about it....

            It's RHEL 8.x which supports gcc 8/9+....

            However, isn't the following saying you can get that for your RHEL 7 (even if it isn't pre-shipped)?
            https://developers.redhat.com/blog/2018/11/13/gcc-8-2-ga-rhel/

            We are pleased to announce general availability of Red Hat Developer Toolset 8 for Red Hat Enterprise Linux 6 and 7. The key new components for this release are:

            GCC 8.2.1
            

            Like other tools, these are easily installable via yum

            M 1 Reply Last reply
            2
            • JonBJ JonB

              @MarkS1955
              For the record, from your qbasicatomic.h:61:4 error message you are falling foul in this code:

              // If C++11 atomics are supported, use them!
              // Note that constexpr support is sometimes disabled in QNX builds but its
              // library has <atomic>.
              #elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX))
              #  include <QtCore/qatomic_cxx11.h>
              ...
              
              // No fallback
              #else
              #  error "Qt requires C++11 support"
              #endif
              

              so it appears to be your lack of constexpr support. Not that I know there's anything you can do about it....

              It's RHEL 8.x which supports gcc 8/9+....

              However, isn't the following saying you can get that for your RHEL 7 (even if it isn't pre-shipped)?
              https://developers.redhat.com/blog/2018/11/13/gcc-8-2-ga-rhel/

              We are pleased to announce general availability of Red Hat Developer Toolset 8 for Red Hat Enterprise Linux 6 and 7. The key new components for this release are:

              GCC 8.2.1
              

              Like other tools, these are easily installable via yum

              M Offline
              M Offline
              MarkS1955
              wrote on last edited by
              #6

              @JonB Oh my gosh, thank you so much! Yea, it always fails on the atomics compile, regardless of what I do. I wonder if I could maybe fall back to a little earlier version of Qt that doesn't rely on this.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SimonSchroeder
                wrote on last edited by
                #7

                GCC 4.8.5 was released in 2015, but GCC 5.1 was also already released at that time. The first version of GCC 4.8 even dates back to 2013. I am not sure if it makes sense to back that far for a proper Qt version.

                On RedHat you should have a look at devtools in order to install newer versions of GCC. These will provide whole programming environments (including proper libraries, etc.) tailored to the selected version.

                JonBJ 1 Reply Last reply
                0
                • S SimonSchroeder

                  GCC 4.8.5 was released in 2015, but GCC 5.1 was also already released at that time. The first version of GCC 4.8 even dates back to 2013. I am not sure if it makes sense to back that far for a proper Qt version.

                  On RedHat you should have a look at devtools in order to install newer versions of GCC. These will provide whole programming environments (including proper libraries, etc.) tailored to the selected version.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @SimonSchroeder said in error Qt requires C++11 support:

                  On RedHat you should have a look at devtools in order to install newer versions of GCC. These will provide whole programming environments (including proper libraries, etc.) tailored to the selected version.

                  I already provided the OP with the link for gcc 8 under RHEL 6/7.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MarkS1955
                    wrote on last edited by
                    #9

                    Hi, I just wanted to say thanks for your replies. I have resolved my issue with this by going back to version 5.12.8. This version gives me everything I need, and also fixes another bug issue we were having with the 5.9.7 distribution. We are up and running, forms compiling now, etc.

                    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