Compiler Error C3140


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

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

cannot have multiple 'module' attributes in the same compilation unit

The module attribute can only be defined once per project.

The following sample generates C3140:

// C3140.cpp  
// compile with: /c  
[module(name = "MyLibrary")];  
[module(name = "MyLibrary2")];   // C3140