Click to See Complete Forum and Search --> : Template functions


Olix
May 19th, 1999, 07:54 AM
Can I use a template function (member function)in a clas that is exported from a DLL?

I've got an error like:
"INTERNAL PREPROCESSOR ERROR"
and something like this and:
"Go to menu Help->Troubleshuting"

Rob Wainwright
May 20th, 1999, 05:11 PM
Template functions have to be defined fully within the scope of the code which is going to use the template function. In the case of a DLL, the template function will need to be completely placed in the header file (and therefore not really in the DLL) for the exe to pick this up.

Template support for the complete ANSI C++ standard is not complete in VC5 (but it is better in VC6) I've had exactly the same error as you're getting whether I've put the template within my exe or within a shared dll. Its normally because I'm trying to do something a little wacky like template functions within template classes etc.