Ok, sorry I will try to be more specific:
vec2.h:
class vec2{public: ... vec2(float nx,float ny) {x=nx;y=ny;} ... vec3 ToVec3() {return vec3(x,y,0);} ...}
vec3.h:
class vec3{public: ... vec3(float nx,float ny,float nz) {x=nx;y=ny;z=nz} ... vec2 ToVec2() {return vec2(x,y);} ...}
When I compile I get an error saying that I use an undefined type vec2 in vec3.h
But as you can see in Math.h before the #include of both vec2.h and vec3.h
I define both classes.
Also each cpp does not include vec2.h or vec3.h directly but rather math.h
SOLVED:
As I was writing this post I solved the problem. I simply had to move the implementation of the functions out of the class definition.
Still I don't get the error messages. The second one about the constructor is ok but the first one about vec2 being undefined, As you can see vec2 was forward declared in Math.h