c++ dll templates (linker error) -
template <class t> class pst_object_recognition_api test { public: t t; inline bool operator==(const test & other) { return t == other.t; } }; class pst_object_recognition_api test_int : public test<int> { };
in other project imports dll have error
error 3 error lnk2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall test<int>::operator==(class test<int> const &)" (__imp_??8?$test@h@@qae_nabv0@@z) referenced in function _main main.obj
how can solve problem?
the solution appears (removing pst_object_recognition_api template class):
template <class t> class test { public: t t; inline bool operator==(const test<t> & other) { return true; } }; class pst_object_recognition_api test_int : public test<int> { };
Comments
Post a Comment