Share via


Compiler Error C3625

'unmanaged type': an unmanaged type cannot derive from a managed type 'unmanaged class'

An unmanaged class cannot inherit from a managed class. For more information, see Classes and Structs (Managed).

The following sample generates C3625:

// C3625.cpp
// compile with: /clr /c
ref class B {};
class D : public B {};   // C3625 cannot inherit from a managed class

The following sample generates C3625:

// C3625_b.cpp
// compile with: /clr:oldSyntax /c
__gc class B {};
class D : public B {};   // C3625  cannot inherit from a managed class