I hit this linker error and am having a little trouble getting past it.
o/foo/bar.cc.o: In function 'foo::bar()': bar.cc:(.text+0x728): undefined reference to 'rf<PlayerInfo> Util::getClosestToGlobal<PlayerInfo>(std::vector<rf<bats::PlayerInfo>, std::allocator<rf<PlayerInfo> > >, Eigen::Matrix<double, 3, 1, 2, 3, 1>)'
Util.h
file defines:
template <class ObjectClass>
static rf<ObjectClass> getClosestToGlobal(
std::vector<rf<ObjectClass> > objects, Eigen::Vector3d targetPosGlobal);
Util.cpp
defines:
template <class ObjectClass>
rf<ObjectClass> Util::getClosestToGlobal(
std::vector<rf<ObjectClass> > objects, Eigen::Vector3d targetPosGlobal)
{
// ...
}
I know that my cpp file compiled successfully as it recreates the .o file as expected.
Have I provided enough information here for someone more experienced to identify the problem? If not, where else should I be looking?