When the config exclude-using-statics-for-enums is enabled, enum members will be fully qualified, which means this will reference an anonymously defined enumeration that is not actually generated. Running the unit test WithAnonymousEnumTestImpl with config exlclude-using-statics-for-enums (copied below for convenience)
enum
{
MyEnum1_Value1 = 1,
};
enum MyEnum2 : int
{
MyEnum2_Value1 = MyEnum1_Value1,
};
Will yield the resulting C# code (I actually used the command ClangSharpPInvokeGenerator.exe -f header.h --output test.cs -n Test.Bar --config exclude-using-statics-for-enums to yield the result):
namespace Test.Bar
{
public enum MyEnum2
{
MyEnum2_Value1 = __AnonymousEnum_header_L1_C1.MyEnum1_Value1,
}
public static partial class Methods
{
public const int MyEnum1_Value1 = 1;
}
}
Which in this case notably references this mysteriously named __AnonymousEnum_header_L1_C1 enum that is not defined, which would not then compile properly.
When the config
exclude-using-statics-for-enumsis enabled, enum members will be fully qualified, which means this will reference an anonymously defined enumeration that is not actually generated. Running the unit testWithAnonymousEnumTestImplwith configexlclude-using-statics-for-enums(copied below for convenience)Will yield the resulting C# code (I actually used the command
ClangSharpPInvokeGenerator.exe -f header.h --output test.cs -n Test.Bar --config exclude-using-statics-for-enumsto yield the result):Which in this case notably references this mysteriously named
__AnonymousEnum_header_L1_C1enum that is not defined, which would not then compile properly.