Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C3862
Collapse the table of content
Expand the table of content

Compiler Error C3862

'function': cannot compile an unmanaged function with /clr:pure or /clr:safe

A compilation with /clr:pure or /clr:safe will produce an MSIL only image, an image with no native (unmanaged) code. Therefore, you cannot use the unmanaged pragma in a /clr:pure or /clr:safe compilation.

For more information, see /clr (Common Language Runtime Compilation) and managed, unmanaged.

The following sample generates C3862:

// C3862.cpp
// compile with: /clr:pure /c
#pragma unmanaged
void f() {}   // C3862

Community Additions

© 2015 Microsoft