I had the following class:
I had not problems with it, and it worked as it should be. Problems rised when ICode:/*! * \brief Provides text drawing-methods for OpenGL. */ class ZTextDrawer2 { public: /* various stuff .......... .......... */ void Draw2DText(DrawPoint<float> p, const char *format, ...); void Draw3DText(DrawPoint<float> p, const char *format, ...); private: /* various stuff .......... .......... */ }
decided it t change it to the following:
In both cases the class is used like that:Code:/*! * \brief Provides text drawing-methods for OpenGL. */ class ZTextDrawer2 { public: /* various stuff .......... .......... */ template<typename Scalar> void Draw2DText(DrawPoint<Scalar> p, const char *format, ...); template<typename Scalar> void Draw3DText(DrawPoint<Scalar> p, const char *format, ...); private: /* various stuff .......... .......... */ }
The problem with the second version of the class is that I get link errors(i use GCC):Code:ZTextDrawer2::GetInstance()->Draw2DText(DrawPoint<float> (0.0f, 0.0f), "ZTextDrawer2");
Why is this link error caused?Code:obj\test.o:test.cpp|| undefined reference to `void Z_GLC::ZTextDrawer2::Draw2DText<float>(Z_GLC::DrawPoint<float>, char const*, ...|



LinkBack URL
About LinkBacks


