<[EMAIL PROTECTED]> wrote in message
news:62117@palm-dev-forum...
>
> 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:
>
> //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"
Anton, is the implementation of CTree<>::Draw visible to the user.
CodeWarrior (and no other C++ compiler) supports template bodies that
aren't part of the include file unless you explicitly instantiated it in
another file. The C++ standard has an "export" keyword for this task,
but almost no one supports it yet. If you actually have the code
definition in your headers, then post back with more info.
Templates do work -- I've used them extensively in some Palm OS
applications I've written.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/