Error C2504 - Base class undefined

c++, visual-studio, visual-studio-2010

Solution

I got this due to circular include.

I included all my headers in "include.h" and include it in everywhere else.

I managed to avoid circular include by just including standard headers in include.h.

Problem

I have a rather simple problem This is my `firstcluster.h` ``` #pragma once #include "cluster.h" class FirstCluster:public Cluster{ ... public: ... }; ``` Code for cluster.h: ``` #pragma once // File: cluster.h class Cluster { protected: ... public: ... }; ``` And i'm getting the error: ``` error C2504: 'Cluster' : base class undefined ``` Sometimes i get this IntelliSense error: ``` IntelliSense: incomplete type is not allowed ... Line 10 Column 27 ``` But it doesn't always come up. The `cluster.h` is included, as you can see, and all other header files are protected with `#pragma once` I really don't know what could go wrong here? Can circular include make problems even if i protected everything with `#pragma once`? I'm using Visual Studio 2010.

Original source