Compiler Error C3377
Visual Studio .NET 2003
'method' : cannot import method - a parameter type or the return type is inaccessible
The method could not be imported because one of the types is not accessible.
The following sample generates C3377:
// C3377.cpp
// compile with: /clr /LD /W1
// C4677 expected
#using <mscorlib.dll>
private __gc class X { }; // C3377 change 'private' to 'public'
public __gc class Y
{
public:
Y() {}
void mf1(X *pX) { } // C4677
};
and then,
// C3377b.cpp
// compile with: /clr
#using "C3377.dll"
#using <mscorlib.dll>
int main()
{
Y *pY = new Y; // C3377
}