编译器错误 C3320

“type”:类型不能和模块的“name”属性同名

导出的用户定义类型 (UDT)(可以是结构、类、枚举或联合)不能与传递到 module 特性的名称属性的参数具有相同名称。

示例

以下示例生成 C3320:

// C3320.cpp
#include "unknwn.h"
[module(name="xx")];

[export] struct xx {   // C3320
// Try the following line instead
// [export] struct yy {
   int i;
};