I have this error now when I compile 1 of my .cpp files. It seems to be because of the namespace line, what must I change to get it to compile correctly?
The corresponding .cpp file only includes this .h file and <cmath>Code:#ifndef VECTOR3D_H #define VECTOR3D_H #include <fstream> #include <GL/glut.h> using namespace std; class Vector3d { public: //data members GLfloat triple[ 3 ]; //constructors Vector3d( ); Vector3d( GLfloat, GLfloat, GLfloat ); Vector3d( Vector3d& ); ~Vector3d( ); //functions GLvoid printVector( ) const; GLfloat length( ) const; GLvoid normalise( ); friend GLfloat dotProduct( const Vector3d& a, const Vector3d& b ); friend Vector3d crossProduct( const Vector3d& a, const Vector3d& b ); GLvoid setValues( GLfloat x, GLfloat y, GLfloat z ); //operators friend Vector3d operator + ( const Vector3d& a, const Vector3d& b ); friend Vector3d operator - ( const Vector3d& a, const Vector3d& b ); friend Vector3d operator * ( const Vector3d& a, const Vector3d& b ); friend Vector3d operator / ( const Vector3d& a, const Vector3d& b ); friend Vector3d operator * ( const Vector3d& a, const GLfloat scalar ); friend Vector3d operator / ( const Vector3d& b, const GLfloat scalar ); friend bool operator == ( const Vector3d& a, const Vector3d& b ); friend bool operator != ( const Vector3d& a, const Vector3d& b ); Vector3d& operator = ( const Vector3d& rvalue ); friend ofstream& operator << ( ofstream& os, const Vector3d& a ); }; #endif



LinkBack URL
About LinkBacks


