Export (0) Print
Expand All
Expand Minimize

Compiler Warning (level 1) C4677

'function': signature of non-private function contains assembly private type 'private_type'

A type that has public accessibility outside the assembly uses a type that has private access outside the assembly. A component that references the public assembly type will not be able to use the type member or members that reference the assembly private type.

The following sample generates C4677:

// C4677a.cpp
// compile with: /clr:noAssembly /LD
#using <mscorlib.dll>
private __gc class A
   void Method() {}

and then,

// C4677b.cpp
// compile with: /clr:noAssembly /LD /W1
#using <mscorlib.dll>
#using "C4677a.dll"
public __gc class B
   A* Method2()   // C4677
      return new A();
© 2015 Microsoft