CentOS 安装QT SDK qt-everywhere-src-5.15.0.tar.xz时报错

状态介绍:

centos7 安装了默认devement tools + 安装好 QT Creator 后,正在配置 QT SDK

参考资料:

CentOS 6.5 下安装 QT 4 - 天涯路清晨 - 博客园 (cnblogs.com)

但是过程中发现 配置 QT SDK 时报错:

[root@dev qt-everywhere-src-5.15.0]# ./configure
+ cd qtbase
+ /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/configure -top-level 
Creating qmake...
.In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h: In instantiation of ‘QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIterableImpl(const T*) [with T = QList]’:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:772:139:   required from here
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: 错误:‘struct QtMetaTypePrivate::ContainerCapabilitiesImpl, void>’的类模板实例化有歧义
       , _iteratorCapabilities(ContainerAPI::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl::ContainerCapabilities << (4+3)))
                                                                                                                                       ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1007:8: 错误:备选是: struct QtMetaTypePrivate::ContainerCapabilitiesImpl().push_back(declval()))>
 struct ContainerCapabilitiesImpl().push_back(std::declval()))>
        ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1025:8: 错误:         struct QtMetaTypePrivate::ContainerCapabilitiesImpl
 struct ContainerCapabilitiesImpl().insert(std::declval())), decltype(std::declval() == std::declval())>>
        ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: 错误:嵌套名指定中使用了不完全的类型‘QtMetaTypePrivate::ContainerCapabilitiesImpl, void>’
       , _iteratorCapabilities(ContainerAPI::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl::ContainerCapabilities << (4+3)))
                                                                                                                                       ^
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1169:68: 错误:嵌套名指定中使用了不完全的类型‘QtMetaTypePrivate::ContainerCapabilitiesImpl, void>’
       , _copyIter(IteratorOwner::assign)
                                                                    ^
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h: In instantiation of ‘QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIterableImpl(const T*) [with T = QStringList]’:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:775:138:   required from here
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: 错误:‘struct QtMetaTypePrivate::ContainerCapabilitiesImpl’的类模板实例化有歧义
       , _iteratorCapabilities(ContainerAPI::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl::ContainerCapabilities << (4+3)))
                                                                                                                                       ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1007:8: 错误:备选是: struct QtMetaTypePrivate::ContainerCapabilitiesImpl().push_back(declval()))>
 struct ContainerCapabilitiesImpl().push_back(std::declval()))>
        ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1025:8: 错误:         struct QtMetaTypePrivate::ContainerCapabilitiesImpl
 struct ContainerCapabilitiesImpl().insert(std::declval())), decltype(std::declval() == std::declval())>>
        ^
In file included from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qmetatype.h:1:0,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qvariant.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/text/qlocale.h:43,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qlocale.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/serialization/qtextstream.h:46,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qtextstream.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/io/qdebug.h:49,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/qdebug.h:1,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/proitems.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeparser.h:34,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/library/qmakeevaluator.h:36,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/project.h:32,
                 from /home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/qmake/main.cpp:30:
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: 错误:嵌套名指定中使用了不完全的类型‘QtMetaTypePrivate::ContainerCapabilitiesImpl’
       , _iteratorCapabilities(ContainerAPI::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl::ContainerCapabilities << (4+3)))
                                                                                                                                       ^
/home/admin/sdk/qt-everywhere-src-5.15.0/qtbase/include/QtCore/../../src/corelib/kernel/qmetatype.h:1169:68: 错误:嵌套名指定中使用了不完全的类型‘QtMetaTypePrivate::ContainerCapabilitiesImpl’
       , _copyIter(IteratorOwner::assign)
                                                                    ^
gmake: *** [main.o] 错误 1

本来以为 qt-everywhere-src-5.15.0.tar.xz版本有问题,又下载 qt-everywhere-src-5.15.2.tar.xz

依然是这样,通过 gcc -v  发现版本是4.8.5 根据网上搜索发现是 gcc版本太低证实了自己的猜想

根据 “CentOS 7升级gcc版本” 升级 gcc 版本后,直接再 ./configure 就ok了,希望可以帮助到兄弟们。

CentOS 7升级gcc版本:https://www.cnblogs.com/jixiaohua/p/11732225.html

你可能感兴趣的:(qt,centos,开发语言)