Possible Duplicate:
Circular Dependencies / Incomplete Types
writing a litte c++ program and be confused....
got 4 classes, 2 important for this error...
got the error message "field 'dot' has incomplete type" in Line 13 and "expected ';' befor '(' token" in same Line
The Error seems to start in the Vector3.cpp, where only the include of the Vector3.h and the empty methodes
deleted the include "Vector3.h" in the Normal3 Header, thought will be running in a circle... not so well...
some ideas? hope so :) and ty for answers
Here are my two important classes:
#ifndef NORMAL3_H
#define NORMAL3_H
class Normal3 {
public:
double x, y, z;
Normal3 mul(Normal3 n);
Normal3 add(Normal3 n);
Normal3 dot(Vector3 v); //Line 13
Normal3(double x = 0, double y = 0, double z = 0)
: x(x), y(y), z(z)
{ }
};
#endif //NORMAL3_H
AAAAAAAAAAAAAAAAAAAAAND
#ifndef VECTOR3_H
#define VECTOR3_H
#include "Normal3.h"
class Vector3 {
public:
double x, y, z, magnitude;
Vector3 add(Vector3 v);
Vector3 add(Normal3 n);
Vector3 sub(Normal3 n);
Vector3 mul(double c);
double dot(Vector3 c);
double dot(Normal3 n);
Vector3 normalized();
Normal3 asNormal();
Vector3 refelctedOn(Normal3 n);
Vector3(double x = 0, double y = 0, double z = 0, double m = 0)
: x(x), y(y), z(z), magnitude(m)
{ }
};
#endif //VECTOR3_H