Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3389

Error Message

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

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 is not allowed.

The following sample generates C3389:

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

Community Additions

ADD
Show:
© 2015 Microsoft