编译器错误 C3641

“function”:对于使用 /clr:pure 或 /clr:safe 编译的函数,调用约定“calling_convention”无效

注解

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

/clr:pure 中只允许 __clrcall 调用约定。

示例

以下示例生成 C3641:

// C3641.cpp
// compile with: /clr:pure /c
void __cdecl f() {}   // C3641