I'm building a program with 3 different files: geomod.h, geomod.cc and projet.cc, where project.cc uses the functions and classes defined in geomod.h. My problem is in geomod.cc. I don't understand why I have the error "undefined reference" when I define the functions that I prototyped in geomod.cc. I started geomod.h by namespace geomod{//rest of geomod.h}
. And I started geomod.cc by using namespace geomod;
.
geomod.h:
namespace geomod{
//other function prototypes and classes
void rebouclement(double v, double &vm, double &vp);
//other function prototypes and classes
}
geomod.cc:
//other #includes
#include "geomod.h"
using namespace geomod;
//code
void rebouclement(double v, double &vm, double &vp) {
//code
return;
}
I get this compilation error in geomod.cc : undefined reference to geomod::rebouclement(double,double&,double&)
I tried adding geomod:: before the function in geomod.cc but it doesnt make a difference