- 305 名前:デフォルトの名無しさん [05/02/11 13:36:27 ]
- テンプレートを使ったクラスでundefined referenceがでます。
ソースは次のようなものです。プリプロセッサは省略してあります。 //temptest.h template<class T> class temptest{ public: temptest(); }; //temptest.cpp template<class T> temptest<T>::temptest(){} //main.cpp int main(){ temptest<int> t; return 0; } gccでは "undefined reference to `temptest<int>::temptest(void)" VisualC++6では "public: __thiscall temptest<int>::temptest<int>(void)は未解決です" というエラーです。 ちなみに定義をインラインにしたらうまくできました。 どなたか解決方法を教えてください。
|

|