Compiler Error C2504

 

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 C2504.

class' : base class undefined

The base class is declared but never defined. Possible causes:

  1. Missing include file.

  2. External base class not declared with extern.

The following sample generates C2504:

// C2504.cpp  
// compile with: /c  
class A;  
class B : public A {};   // C2504  

// OK

class C{};  
class D : public C {};  

Show: