首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >type_traits错误

type_traits错误
EN

Stack Overflow用户
提问于 2013-04-10 16:01:46
回答 1查看 1.7K关注 0票数 1

在VS2010中,我添加了

代码语言:javascript
复制
#include <iostream>

为了对应用程序模板进行控制,我在type_traits中遇到了许多错误

代码语言:javascript
复制
error C2275: '_Ty' : illegal use of this type as an expression  c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits  762 1   pcl1 (Visual Studio 2010)
error C3861: '__is_standard_layout': identifier not found   c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits  762 1   pcl1 (Visual Studio 2010)
error C2955: 'std::_Cat_base' : use of class template requires template argument list   c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits  763 1   pcl1 (Visual Studio 2010)
error C2275: '_Ty' : illegal use of this type as an expression  c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits  768 1   pcl1 (Visual Studio 2010)
an many others...

我不知道为什么,但我认为这与我同时使用VS2012和VS2010这一事实有关。如何修复它?

EN

回答 1

Stack Overflow用户

发布于 2013-04-11 02:31:42

从错误消息中可以清楚地看出,您的VS2010项目以某种方式被引导到VS2012包含目录c:\program files (x86)\microsoft visual studio 11.0\vc\include中查找。这从来都不是一个好主意。

检查C/C++ / General / Additional Include目录下的项目设置。删除对编译器包含目录的任何引用。编译器的正确目录将由系统自动定位。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15920195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档