Advertisement

c++ template

Started by August 20, 2000 08:41 PM
1 comment, last by Wes Henwood 24 years, 4 months ago
In VC++, I created a class using insert>new class. I got the class working with one type, and then tried to convert it over to a template. The definition is in the .h file, the implemenation in the .cpp file, as normal. When I try declaring and using the template class, I get unresolved external errors. Does anyone know what I''m doing wrong? Wes Henwood denethor1@hotmail.com
Unresolved external means that the compiler cant see something that you are saying is there, so try including all the headers and libraries, and make sure you have declared the functions properly as well.
Advertisement
With VC++ you must put the entire definition of a template class in the header file. Move your function definitons below the class declaration and drop the .cpp file and all should be well.

This topic is closed to new replies.

Advertisement