Compiler Error C3320

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3320.

type': type cannot have the same name as the module 'name' property

An exported user-defined type (UDT), which could be a struct, class, enum, union or __value, cannot have the same name as the parameter passed to the module attribute's name property.

The following sample generates C3320:

// C3320.cpp  
#include "unknwn.h"  
[module(name="xx")];  
  
[export] struct xx {   // C3320  
// Try the following line instead  
// [export] struct yy {  
   int i;  
};  

Show: