Hello, 
Should I change options in code generator or linker writing my own 
templates? I use code warrior and get linker error when try to write 
templates. Here is sample code:
template <class T> class CTree:public CCanvas{
public:

Char guid[50];
CTree* parent; // parent tree.
Int16 level; // temporal probably
CTree();
~CTree();
void Draw(CharPtr Str);
void Redraw();
Ivirtual void SetGuid(const CharPtr g); 
CTree* GetCurrentTree();
protected:

};

//implementation:
template <class T> CTree<T>::Draw()
{
/////
}
//etc.


//example of using
CTree<int>* tree=new CTree<int>;
tree->Redraw();
I got an error:"LinkerError CTree<int>::Draw() referenced from 
Starter.cpp is undefined"
Thanks in advance,
Anton

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to