http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

function templates in VC++



   Hello,
 
   Quick question:  I can't seem to get any generic functions to work with VC 6. The code compiles,
but I get an linker error saying that the linker is unable to find the version of the template that I am using.
For example say I have :
 
template <typename T>void * MT_Interpolate(T ,T,T*)
{
/* blah blah */
}
 
  And I've explicitly declared the versions I wish to use as so:
 
void * MT_Interpolate(CVector,CVector,CVector*);
void * MT_Interpolate(fixed64,fixed64,fixed64 *);
 
// and so on...
 
  But I still get linker errors whenever I call a routines generated by a template ie:
 
void CScene::Update(void (*blah_blah)(volitale byte_ptr),string)
{
    MT_Interpolate<fixed64>(this->blah,blah,&blah); // creates linker error
}
 
  Any help would be appreciated.
 
  Josiah