Original Post
I've been hacking at this thing for an hour. The compiler is .NET. The error I keep getting is: error C2143: syntax error : missing ',' before '&'. in reference to some function arguments.
The problem lies with two file Vertex.h and Vector3.h. In Vertex there is a class named Vertex3 and it has an overloaded operator:
Vertex3 operator +(const Vector3& vector) const
{
Vertex3 result(_x +vector.x(), _y +vector.y(), _z +vector.z() );
return result;
}
The 'const Vector3&' is the '&' the error is refering too. The argument is a vector so I've included Vector3.h for the Vector3 class.
In vector3.h I have another problem function in the Vector3 class. This uses the Vertex3 class so i've included vertex.h:
float Dot(const Vertex3& vertex) const //Dot product
{
return float(_x * vertex.x()+ _y + vertex.y()+ _z * vertex.z() );
}
I get the same error for this function. But depending on how I include the header files in each other or in other header files, I can make the second error go away. The first function generates the same error 5 times while the second only generated 1. The files are defined correctly and it's able to find everything it needs. All the code is fairly plain, no really fancy OOP relationships.
I must be mixing something up with the include files? I'll check up on this tonight, so if you need more info I'll respond promptly. Thanks in advance!
[edited by - chipmunk1886 on January 15, 2003 7:04:25 PM]
[edited by - chipmunk1886 on January 15, 2003 7:35:57 PM]