gpt4 book ai didi

c++ - Qt nmake : error C3203: 'map' : unspecialized class template can't be used as a template argument for template parameter 'base' , 需要一个真实类型

转载 作者:行者123 更新时间:2023-11-28 04:58:19 29 4
gpt4 key购买 nike

当我尝试编译 Qt 时,在 VS2015 x86 Native Tools Command Prompt 中发出 nmake 命令时遇到了这个问题:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\hash_map(17): error C2338: <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\hash_set(17): error C2338: <hash_set> is deprecated and will be REMOVED. Please use <unordered_set>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
c:\Qt-2015\4.8.6\msvc2015\src\3rdparty\clucene\src\CLucene/util/VoidMap.h(228): error C2923: 'std::map': 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Compare' is not a valid template type argument for parameter '_Pr'
with
[
_Kty=lucene::index::IndexReader::CloseCallback,
_Ty=void *,
_Pr=lucene::index::IndexReader::CloseCallbackCompare,
_Alloc=std::allocator<std::pair<const lucene::index::IndexReader::CloseCallback ,void *>>
]
c:\Qt-2015\4.8.6\msvc2015\src\3rdparty\clucene\src\CLucene/index/IndexReader.h(96): note: see reference to class template instantiation 'lucene::util::CLSet<lucene::index::IndexReader::CloseCallback,void *,lucene::index::IndexReader::CloseCallbackCompare,lucene::index::IndexReader::CloseCallbackCompare,lucene::util::Deletor::Dummy>' being compiled
c:\Qt-2015\4.8.6\msvc2015\src\3rdparty\clucene\src\CLucene/util/VoidMap.h(229): error C2923: 'std::map': 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Compare' is not a valid template type argument for parameter '_Pr'
with
[
_Kty=lucene::index::IndexReader::CloseCallback,
_Ty=void *,
_Pr=lucene::index::IndexReader::CloseCallbackCompare,
_Alloc=std::allocator<std::pair<const lucene::index::IndexReader::CloseCallback ,void *>>
]
c:\Qt-2015\4.8.6\msvc2015\src\3rdparty\clucene\src\CLucene/util/VoidMap.h(230): error C3203: 'map': unspecialized class template can't be used as a template argument for template parameter 'base', expected a real type
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

我关注了these设置 Qt 的步骤,我在第 6 步遇到了错误。

有什么想法吗?我很感激。

最佳答案

这是QT 5.5之前的版本用visual studio 14.0编译时的bug。

我猜你正在尝试编译 4.8 版。

查看下面的链接....您可以看到您的错误。

https://bugreports.qt.io/browse/QTBUG-45961

您可能需要下载Qt5.5或以上版本才能使用visual studio 14.0进行编译。

关于c++ - Qt nmake : error C3203: 'map' : unspecialized class template can't be used as a template argument for template parameter 'base' , 需要一个真实类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46692227/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com