I am sorry for asking this question, I know there are a lot of similar questions online, but I wasn't able to solve my problem. My files look something like this:
File class_a.h
:
#ifndef CLASS_A_H
#define CLASS_A_H
#include "class_b.h"
class class_a{
//...
class subclass_of_a{
class_b obj_b;
}
}
File class_a.cpp
:
#include "class_a.h"
//...
class_a::subclass_of_a(...) : obj_b(...){
//...
}
File class_b.h
:
#ifndef CLASS_B_H
#define CLASS_B_H
#include "class_a.h"
class class_b{
double function(class_a::subclass_of_a const &obj_a);
}
This results in following error:
’class_a’ does not name a type
I hope you can help me with this problem.