编译器警告 C4936

只有使用 /clr 或 /clr:pure 编译时,才支持此 __declspec

备注

“/clr:pure”编译器选项在 Visual Studio 2015 中已弃用,在 Visual Studio 2017 中不受支持

使用了 __declspec 修饰符,但只有在编译时使用 __declspec /clr 选项之一的情况下 修饰符方才有效。

有关详细信息,请参见 应用程序域过程

始终发出 C4936 错误。 可以使用 warning 杂注来禁用 C4936。

示例

下面的示例生成 C4936:

// C4936.cpp
// compile with: /c
// #pragma warning (disable : 4936)
__declspec(process) int i;   // C4936
__declspec(appdomain) int j;   // C4936