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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -