Kompilatorfel C3389

__declspec(nyckelord) kan inte användas med /clr:pure eller /clr:safe

Anmärkningar

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

En __declspec modifier använd innebär ett tillstånd per process. /clr:pure innebär ett tillstånd för varje appdomain . Därför är det inte tillåtet att deklarera en variabel med nyckelordsmodifieraren __declspec och kompilera med/clr:pure.

Example

I följande exempel genereras C3389:

// C3389.cpp
// compile with: /clr:pure /c
__declspec(dllexport) int g2 = 0;   // C3389