错误 C1191
只能在全局范围内导入“dl”
将 mscorlib.dll 导入使用 /clr 编程的程序中的说明不能出现在命名空间或函数中,但必须出现在全局范围内。
以下示例将生成 C1191:
// C1191.cpp
// compile with: /clr
namespace sample {
#using <mscorlib.dll> // C1191 not at global scope
}
可能的解决方法:
// C1191b.cpp
// compile with: /clr /c
#using <mscorlib.dll>
namespace sample {}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈