Hi Anne,
You might have missed this posting I sent yesterday but....
You may want to check out the MSL C++ Compiler Reference, which is on your
installation in PDF form, page CCR-73. It describes how to use templates -
much better than I can describe here :-)
Rgds,
Jun-Kiat Lam
Metrowerks Technical Support
At 12:28 PM 8/3/2000 +0530, you wrote:
>Hai,
>I am trying to use template classes in my application.
>I have 3 files.
> 1. Header.h -- This is header file for class definition
> 2. Impl.cpp -- This is implementation file for class in
>Header.h
> 3. Starter.cpp -- This is my main file
>
> The files are as follows :
>
> Header.h
> template <class Type>
> class a
> {
> public:
> int b;
> void add(int c,int d);
> };
>
> Impl.cpp
> # include "Header.h"
> template <class Stype> void a<Stype> ::add(int d,int l)
> {
> b=(d+l);
> }
>
> Starter.cpp
> // All includes....
> #include "Header.h"
> // All other functions....
> // ......
> case frmOpenEvent:
> {
> // All necessary code....
> a<int> a1;
> a1.add(12,13);
> int k=a1.b;
> // All necessary code
> }
>
>Problem is that when i complie this code it's compling with out a
>error.
>But when i try to link it its giving me a link error saying that
>a<int>::add(int,int) referenced from mainformhandleevent is undefined.
>
>What is the problem?
>
>Thanks in advance
>
>Regards
>
>--
>Anne Srinivas
>Software Engineer
>InfoTech Enterprises Ltd.
>Plot No 11,Infocity,
>Software Units Layout,
>Madhapur,Hyderabad 33
>
>E-Mail :
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>
>Tel (Resi) : 3033761
>
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/