当前位置: 代码迷 >> VC >> 请教一个error C2872: “IServiceProvider”: 不明确的符号有关问题
  详细解决方案

请教一个error C2872: “IServiceProvider”: 不明确的符号有关问题

热度:5633   发布时间:2013-02-25 00:00:00.0
请问一个error C2872: “IServiceProvider”: 不明确的符号问题?
C/C++ code
#include<Winsock2.h>#using <System.dll>#using <System.Security.dll>#using <System.Xml.dll>#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","rsEOF")using namespace System;using namespace System::IO;using namespace System::Xml;using namespace System::Security::Cryptography;using namespace System::Security::Cryptography::Xml;using namespace System::Security::Cryptography::X509Certificates;using namespace System::Text;using namespace DevelopDotNet::Compression;

C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ocidl.h(6238) : error C2872: “IServiceProvider”: 不明确的符号
1> 可能是“c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider”
1> 或 “c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider”
1>d:\program files\microsoft visual studio 9.0\vc\include\comdefsp.h(1041) : error C2872: “IServiceProvider”: 不明确的符号
1> 可能是“c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider”
1> 或 “c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider”
1>d:\program files\microsoft visual studio 9.0\vc\include\comdefsp.h(1041) : error C2872: “IServiceProvider”: 不明确的符号
1> 可能是“c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider”
1> 或 “c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider”
这个错怎么解决呀?求救了呀!

------解决方案--------------------------------------------------------
探讨

引用:
删除using namespace System

remove using namespace System. You are injecting a lot of types into the global namespace to every file that includes the header file, and you are ……

------解决方案--------------------------------------------------------
1、直接用名称空间限定 System::IServiceProvider
------解决方案--------------------------------------------------------
sdk版本太低了
  相关解决方案