Kompilatorfel C2812

#import stöds inte med /clr:pure och /clr:safe

Anmärkningar

Alternativen /clr:pure och /clr:safe compiler är inaktuella i Visual Studio 2015 och stöds inte i Visual Studio 2017.

#import-direktivet stöds inte med /clr:pure och /clr:safe eftersom #import det kräver användning av interna stödbibliotek för kompilatorn.

Example

I följande exempel genereras C2812.

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