编译器错误 C2812
#import 不支持 /clr:pure 和 /clr:safe
备注
“/clr:pure”和“/clr:safe”编译器选项在 Visual Studio 2015 中已弃用,并且在 Visual Studio 2017 中不受支持。
/clr:pure 和 /clr:safe 不支持 #import 指令,因为 #import
需要使用本机编译器支持库。
示例
以下示例生成 C2812。
// C2812.cpp
// compile with: /clr:pure /c
#import "importlib.tlb" // C2812
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈