Last active
August 29, 2015 14:05
-
-
Save jugemjugem/33410c2cac3bb29d4926 to your computer and use it in GitHub Desktop.
vs2013 で、 "error C2872: 'IServiceProvider' : あいまいなシンボルです。 " とエラーが出たときのノート
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// こんなエラーが出て | |
// xx\servprov.h(92): error C2872: 'IServiceProvider' : あいまいなシンボルです。 | |
// xx\servprov.h(45) の可能性があります : System::IServiceProvider IServiceProvider'' | |
// yy\.netframework\v4.5.1\mscorlib.dll : System::IServiceProvider' | |
#pragma once | |
// デフォルトの using を消す。 | |
// using namespace System; | |
// 他にも、COM 用インターフェイスの include など、 | |
// 内部で広範に include されているので、予期せぬところで上記エラーが出ることがある。 | |
#include <Windows.h> | |
namespace ClassLibrary1 { | |
// 改めて using する。 | |
// managed code は普通はどこかの名前空間内にいるので、 | |
// global で using namespace する必要はないはず? | |
using namespace System; | |
public ref class Class1 | |
{ | |
// 実装 | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment