Compiler Error C3387
'member' : __declspec(dllexport)/__declspec(dllimport) cannot be applied to a member of a managed or WinRT type
The dllimport
and dllexport __declspec
modifiers are not valid on members of a managed or Windows Runtime type.
The following sample generates C3387 and shows how to fix it:
// C3387a.cpp
// compile with: /clr /c
ref class X2 {
void __declspec(dllexport) mf() { // C3387
// try the following line instead
// void mf() {
}
};
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