コンパイラ エラー C3387

'member' : __declspec(dllexport)/__declspec(dllimport) はマネージド型または WinRT 型のメンバーに適用できません

dllimport および dllexport__declspec 修飾子は、マネージド型または Windows ランタイム型のメンバーでは有効でありません。

次の例では C3387 を生成し、その修正方法を示しています。

// C3387a.cpp
// compile with: /clr /c
ref class X2 {
   void __declspec(dllexport) mf() {   // C3387
   // try the following line instead
   // void mf() {
   }
};