编译器错误 C3174

未指定 module 属性

使用 Visual C++ 属性的程序也没有使用 module 属性,该属性是任何使用属性的程序所必需的。

下面的示例生成 C3174:

// C3174.cpp
// C3174 expected
// uncomment the following line to resolve this C3174
// [module(name="x")];
[export]
struct S
{
   int i;
};

int main()
{
}