繁体   English   中英

参考 C++/CLI 项目,C++/CLI 枚举未显示在 C# 中

[英]C++/CLI enum not showing up in C# with reference to C++/CLI project

我无法让 C++/CLI 枚举的内容显示在 C# 项目中。

我可以看到我写的 class 内部,甚至可以看到枚举,但我看不到枚举值。 所以我不能在我的 C# 端使用这个东西。

C++/CLI 枚举的内容不会显示的任何原因。

我的 C++/CLI 项目被编译为混合使用 C++ 库。

我正在使用 Visual Studio 2005。

确保您使用enum class创建与 .NET 兼容的枚举,而不是原生 C++ enum类型。

Later versions of Visual C++ require public enum class , to disambiguate from the enum class contextual keyword which is part of C++11 (and therefore creates a native type).

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM