Compiler Error C2812
#import is not supported with /clr:pure and /clr:safe
Remarks
The /clr:pure and /clr:safe compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
#import Directive is not supported with /clr:pure and /clr:safe because #import
requires the use of native compiler support libraries.
Example
The following sample generates C2812.
// C2812.cpp
// compile with: /clr:pure /c
#import "importlib.tlb" // C2812
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for