Unsolved Installed Qt 5.14.2 [ Build failed with C++ 11 ]
-
I installed Qt 5.15.2 version in RHEL 7.9 and my project .pro file already contains
CONFIG += c++11
while building the qml application, getting the below error
''
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:61: error: #error "Qt requires C++11 support"
In file included from ../../Qt/5.14.2/gcc_64/include/QtCore/qatomic.h:46:0,
from ../../Qt/5.14.2/gcc_64/include/QtCore/qglobal.h:1302,
from ../../Qt/5.14.2/gcc_64/include/QtGui/qtguiglobal.h:43,
from ../../Qt/5.14.2/gcc_64/include/QtGui/qguiapplication.h:43,
from ../../Qt/5.14.2/gcc_64/include/QtGui/QGuiApplication:1,
from ../helloworld1/main.cpp:1:
../../Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"error "Qt requires C++11 support"
^
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:94: error: ‘QAtomicOps’ does not name a type
../../Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:94:13: error: ‘QAtomicOps’ does not name a type
typedef QAtomicOps<T> Ops;
^
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:94: error: ‘QAtomicOps’ does not name a type
../../Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:94:13: error: ‘QAtomicOps’ does not name a type
typedef QAtomicOps<T> Ops;
^
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:97: error: ‘::IsSupported’ has not been declared
../../Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:97:51: error: ‘::IsSupported’ has not been declared
Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform");
^
../../Qt/5.14.2/gcc_64/include/QtCore/qglobal.h:121:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
^
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qglobal.h:121: error: non-constant condition for static assertion
../../Qt/5.14.2/gcc_64/include/QtCore/qglobal.h:121:49: error: non-constant condition for static assertiondefine Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
^
../../Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’
Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform");
^
/home/senthilandavan/Qt/5.14.2/gcc_64/include/QtCore/qbasicatomic.h:97: confused by earlier errors, bailing out
:-1: error: [main.o] Error 1
'''
Please help me -
As the error message already tells you your compiler does not (properly) support c++11. Upgrade your compiler to at least gcc5.3.1 as documented here: https://doc.qt.io/qt-5.14/supported-platforms.html
-
@Christian-Ehrlicher Thank you. I am trying to install gcc updated version. If possible, could you share me how to download gcc .
-
@SAndavan-Palani said in Installed Qt 5.14.2 [ Build failed with C++ 11 ]:
If possible, could you share me how to download gcc .
I don't know how you install packages on RHEL.
-
Hi,
Since you are on RedHat, their documentation is your friend. Look for yum.