Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

error Qt requires C++11 support



  • 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


  • Qt Champions 2019

    @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?



  • @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"



  • 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.



  • @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



  • @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.



  • 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.



  • @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.



  • 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.


Log in to reply