Muokkaa

Jaa


Compiler Error C3389

__declspec(keyword) cannot be used with /clr:pure or /clr:safe

Remarks

The /clr:pure and /clr:safe compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.

A __declspec modifier used implies a per-process state. /clr:pure implies a per-appdomain state. So, declaring a variable with the keyword __declspec modifier and compiling with /clr:pure isn't allowed.

Example

The following sample generates C3389:

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