error C2871: “System”: 具有该名称的命名空间不存在 的解决办法

来源:互联网 发布:淘宝相似问题怎么看 编辑:程序博客网 时间:2024/06/03 23:06

头文件中:

using namespace System;
using namespace System::Threading;

//编译中出现

.\A.cpp(6) : error C2871: “System”: 具有该名称的命名空间不存在
.\A.cpp(7) : error C2653: “System”: 不是类或命名空间名称
.\A.cpp(7) : error C2871: “Threading”: 具有该名称的命名空间不存在

原因是 程序是托管代码,在项目设置中 选择

公共语言运行库支持(/clr)项 ,就好了!


参考:http://hi.baidu.com/webvscan/item/844baafcc053b8ef1a111f16