Compiler Error C3625

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3625.

native_type': a native type cannot derive from a managed or WinRT type 'type'

A native class cannot inherit from a managed or WinRT class. For more information, see Classes and Structs.

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  

Show: