class templates
Hello
Im trying to maek a class template to hold a type of vertex buffer. and i get the unresolved external symbol error when i compile. I declare the class like this
template
class vb
{
};
then the function definitions are like this
template
returnType vb::functionName()
{
}
thanks for any help.
Place the function definitions in the header file - the compiler needs to be able to see them when it instantiates your template class.
If I''m not wrong, you have to supply template parameter, so:
template<class T> vb {
}
template void vb<T>::function()
{}
template<class T> vb {
}
template void vb<T>::function()
{}
quote:Original post by Anonymous Poster
If I''m not wrong, you have to supply template parameter
You''re not wrong, but he has included that. It''s just that it''s been munged by your browser''s HTML parser.
isn''t there a way i can have the definitions in a seperate cpp file? can i do anything with "extern" that might solve this prob?
thanks for input
:::Al:::
[Triple Buffer V2.0] - Resource leak imminent. Memory status: Fragile
thanks for input
:::Al:::
[Triple Buffer V2.0] - Resource leak imminent. Memory status: Fragile
quote:Original post by alfmga
isn''t there a way i can have the definitions in a seperate cpp file?
Yes. Buy Comeau 4.3.
quote:
can i do anything with "extern" that might solve this prob?
No. You''re going to have to live with it. What do you need them in a seperate file for anyway?
quote:No. You''re going to have to live with it. What do you need them in a seperate file for anyway?
ah well. ok
i dont *need* them in a seperate file, i just *like* them in a seperate file, but it''s all good Thanks anyway
:::Al:::
[Triple Buffer V2.0] - Resource leak imminent. Memory status: Fragile
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement