次の方法で共有


コンパイラ エラー C3387

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

注釈

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

Example

次の例では C3387 が生成され、修正方法が示されています。

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