We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am receiving this error in the build log, I can see it is a linking error, but all of the functions are defined in their necessary .cpp files and declared in the relevant header file.
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build Project 'Game' - Target 'NXP LPC4088' linking... .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::Vector(float, float, float) (referred from matrix3x3.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::Vector() (referred from quaternion.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::operator /=(float) (referred from quaternion.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Quaternion::Magnitude() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Quaternion::operator /=(float) (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Quaternion::operator +=(Quaternion) (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::Reverse() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::Magnitude() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::Normalise() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::operator -=(Vector) (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::operator -() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Vector::operator +=(Vector) (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Matrix3x3::Inverse() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Matrix3x3::Transpose() (referred from physics.o). .\Objects\Game.axf: Error: L6218E: Undefined symbol Matrix3x3::Matrix3x3() (referred from physics.o). Not enough information to list image symbols. Finished: 1 information, 0 warning and 15 error messages. ".\Objects\Game.axf" - 15 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:00
Here is the Vector.h class as an example:
#ifndef VECTOR_H #define VECTOR_H //Vector Class definition and function prototypes class Vector{ public: float x; float y; float z; Vector(void); Vector(float xi, float yi, float zi); float Magnitude(void); void Normalise(void); void Reverse(void); Vector& operator+=(Vector u); Vector& operator-=(Vector u); Vector& operator*=(float s); Vector& operator/=(float s); Vector operator-(void); }; #endif
and here is an example of some of the Vector.cpp
#include <math.h> #include "Vector.h" //-------------------------------------------------------------------------------------------------------------------------------------- //Vector member functions //-------------------------------------------------------------------------------------------------------------------------------------- //Constructor no arguments inline Vector::Vector(void) { x=0; y=0; z=0; } //Constructor with defined arguments inline Vector::Vector(float xi, float yi, float zi) { x=xi; y=yi; z=zi; } //Magnitude inline float Vector::Magnitude(void) { return(float) sqrt(x*x + y*y +z*z); } //Normalise inline void Vector::Normalise(void) { float const tol = 0.0001f; float m = (float) sqrt(x*x + y*y +z*z); if(m<=tol) m=1; x /= m; y /= m; z /= m; if(fabs(x) < tol) x = 0.0f; if(fabs(y) < tol) y = 0.0f; if(fabs(z) < tol) z = 0.0f; }
Please tell me if I've made a stupid mistake but I feel as though I can't progress past this error alone.