undefined reference to template function

I have a class that has several template functions, designed to take a std::vector<T>& parameter, where T is intended to be a boost::tuple type. the class is defined in a .h file, and the code is in a .cpp file. when I try to call the function with a vector of tuples, the linker complains about an undefined reference to a function with the parameter types I gave it. my question is: does the code for the template functions need to be in the .h file with the rest of the class definition, or can it be the way I have it now?

I seem to recall that they intend to change that in c++0x, and allow instantiation of templates from other translation units. that will be nice... no more inflated header files. in order to solve this problem, my header went from 300 lines to over 1200, but at least it works, so I won't complain too loudly.

I seem to recall that they intend to change that in c++0x, and allow instantiation of templates from other translation units. that will be nice... no more inflated header files. in order to solve this problem, my header went from 300 lines to over 1200, but at least it works, so I won't complain too loudly.

No, that already exists with the export keyword. But very very few compilers actually implement it. I only know of Cameu (I think that's how it's spelled?).
You can also separate template functions / classes. Declarations and definitions/implementations and put them in separate files.

Originally Posted by Adak

io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.

Originally Posted by Salem

You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.