when I compile, i get the error msg "test.cpp:(.text+0x2a): undefined reference to `homoPair<double>::homoPair(double, double)'", i am very confused. can anyone explain why this error occurs?
thanks a lot.
When dealing with templates, they need to be compiled with your program, not separately. The way to correct this is to either #include pair.cpp at the bottom of pair.h and remove pair.cpp from your project/compiler command or you can just copy/paste the code from pair.cpp to pair.h and eliminate pair.cpp altogether.