Compiler Error C3175
'function1' : cannot call a method of a managed type from unmanaged function 'function2'
Unmanaged functions cannot call member functions of managed classes.
The following sample generates C3175:
// C3175_2.cpp
// compile with: /clr
ref struct A {
static void func() {
}
};
#pragma unmanaged // remove this line to resolve
void func2() {
A::func(); // C3175
}
#pragma managed
int main() {
A ^a = gcnew A;
func2();
}
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