Compiler Error C2812

 

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 C2812.

import is not supported with /clr:pure and /clr:safe

#import Directive is not supported with /clr:pure and /clr:safe because #import requires the use of native compiler support libraries.

The following sample generates C2812.

// C2812.cpp  
// compile with: /clr:pure /c  
#import "importlib.tlb"   // C2812  

Show: