On Wed 03 Mar 2004 at 15:45:05, Von Fugal said:
> However, for some reason whenever I try to
> link the program, all I get is 'undefined reference's to function calls
> belonging to the templates. Could anyone be so kind as to enlighten me to
> possible causes and solutions to this problem? I've strained my brain and
> the chapter on templates in my c++ book to no avail.

I created a similar problem for myself back when I had a CS class in
high school (5 years ago).  I don't remember all the details, but
templates aren't functions (obviously), they're just shells of
functions.  In order for the function call to work, you have to specify
the data types of the parameters at compile time, even before linking.
So a template like:

     genericType fooFunction< genericType , genericType >

will compile, but you can't link to it because there are no specified
parameter types.  You have to make a real function out of it, like

     int fooFunction( int, int )

in order for it to work.

Terribly vague answer, but it should point you in the right direction.

-- 
Soren Harward <[EMAIL PROTECTED]>
http://theboard.byu.edu/

Attachment: signature.asc
Description: Digital signature

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to