Qt nmake:错误 C3203:"map":非专用类模板不能用作模板参数"base"的模板参数,预期为真实类型
Qt nmake: error C3203: 'map': unspecialized class template can't be used as a template argument for template parameter 'base', expected a real type
当我
尝试编译Qt时,我在VS2015 x86 Native Tools Command Prompt
中发出nmake
命令时遇到此问题:
C:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDEhash_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.0VCINCLUDEhash_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-20154.8.6msvc2015src3rdpartyclucenesrcCLucene/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-20154.8.6msvc2015src3rdpartyclucenesrcCLucene/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-20154.8.6msvc2015src3rdpartyclucenesrcCLucene/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-20154.8.6msvc2015src3rdpartyclucenesrcCLucene/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.0VCBINcl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINnmake.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.
我已经按照这些步骤设置了Qt,但在步骤6中遇到了错误。
有什么想法吗?我很感激。
这是使用
Visual Studio 14.0 编译时 QT 5.5 之前的一个错误。
我猜您正在尝试编译 4.8 版。
查看下面的链接....您可以看到您的错误。
https://bugreports.qt.io/browse/QTBUG-45961
您可能需要下载 Qt5.5 或更高版本才能使用 Visual Studio 14.0 进行编译。
相关文章:
- 如何反转整数参数包
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 如何使用默认参数等选择模板专业化
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 将数组作为参数传递给函数安全吗?作为第三方职能部门,可以探索他们想要的之外的其他元素
- 函数调用中参数的顺序重要吗
- 部分定义/别名模板模板参数
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- 使用不带参数的函数访问结构元素
- 基于另一个成员参数将函数调用从类传递给它的一个成员
- 如何在OMNET++中指定与命令行参数组合的输出文件名
- 如何使用Luacneneneba API正确读取字符串和表参数
- 在派生函数中指定void*参数
- 视图中的参数推导失败:take_while
- 用static_cast(*this)...初始化可变参数CRTP:<Base>合法吗?
- 派生运算符<接收 Base 对象作为参数
- Qt nmake:错误 C3203:"map":非专用类模板不能用作模板参数"base"的模板参数,预期为真实类型
- 允许使用“using Base::operator T”,其中“T”是模板类型参数