im new in c++, basicly im getting this error:
/tmp/ccnrIk9I.o: In function `initgl()':
main.cpp:(.text+0x8e): undefined reference to `TSphere::TSphere(float, float)'
/tmp/ccnrIk9I.o: In function `display()':
main.cpp:(.text+0x186): undefined reference to `TSphere::getPosv()'
/tmp/ccnrIk9I.o: In function `idle()':
main.cpp:(.text+0x1fe): undefined reference to `TSphere::test()'
collect2: error: ld returned 1 exit status
I have included the sphere.h in my main.cpp code, it seems like the compiler does not know anything abut my sphere.cpp file, any ideas on what im doing wrong?
Here is my sphere.h code:
#ifndef sphere_h
#define sphere_h
#include <stdlib.h>
#include <time.h>
#include <math.h>
typedef class TSphere
{
private:
float maxpos;
float pos[3];
float dir[3];
float speed;
public:
TSphere(float maxpos,float speed);
void test();
void modifySpeed(float inc);
float* getPosv();
} TSphere;
#endif
And my sphere.cpp file that has #include "sphere.h" with its contstuctor and other methods