编译器错误 C3386
“type-name”:
__declspec(dllexport)
/__declspec(dllimport)
不能应用于托管类型或 WinRT 类型
dllimport
和 dllexport
__declspec
修饰符在托管类型或 Windows 运行时类型上无效。
下面的示例生成 C3386,并演示如何修复此错误:
// C3386.cpp
// compile with: /clr /c
ref class __declspec(dllimport) X1 { // C3386
// try the following line instead
// ref class X1 {
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈