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.
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.
I've had the exact same problem, adding
#ifndef CLUSTER_H
#define CLUSTER_H
/* your code */
#endif
helped to solve the problem. the ifndef part is obviously for include duplications but "define", i think, did help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With