samedi 23 juillet 2016

Error: "class" does not name a type

I am working with two classes.

class1.cpp
#include "class1.h"  
class class1; // forward declaration

...

class1.h
#include "class2.cpp"
...

class2.cpp
#include "class2.h"
...

class.h
//include nothing
...

I am working with the class created in class2 in class1.h and class1.cpp.

I am getting:

error: ‘[...]’ does not name a type

I know it has something to do with that the compiler does not know the class yet, but why? I foreward declared it and I linked everything together...

Aucun commentaire:

Enregistrer un commentaire