0
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>
{
};
在其中進口該DLL的其他項目,我有這樣的錯誤C++ DLL模板(連接錯誤)
Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall test<int>::operator==(class test<int> const &)" ([email protected]@@[email protected]@Z) referenced in function _main main.obj
我怎樣才能解決這個問題?
想到了它,我的答案可能有點誤導(所以我刪除了它)。一個想法,當你寫「test x = new test_int」時,你的客戶端代碼會發生什麼? –
Jimmy
2011-02-17 19:25:44