Here is my problem.
I have a class Template define like this.
// File Vecteur.h
template<class Elem>
class Vecteur : public AdenEtEve
{
public :
...
BOOL bInserer (Elem &elemAInserer, MOT32 wIndice);`
...
protected:
Elem elem;
Elem *pElem;
MOT32 wNbElem;
}
template<class Elem>
BOOL Vecteur<Elem>::bInserer (Elem &elemAInserer,
MOT32 wIndice)
{
BOOL bResultat = FAUX;
Elem *pelemTampon;
// Adjust insertion point if necessary
if (wIndice > wNbElem)
wIndice = wNbElem;
// Add space for new vector
pelemTampon = new Elem [wNbElem + 1];
if (pelemTampon)
{
Elem *pelemCible, *pelemSource;
pelemCible = pelemTampon;
pelemSource = pelem;
// Add items that are before insertion point
MOT32 w = wIndice;
while (w--)
*pelemCible++ = *pelemSource++;
// Add the new one
*pelemCible++ = elemAInserer;
// Add the rest of elements
w = wNbElem - wIndice;
while (w--)
*pelemCible++ = *pelemSource++;
if (pelem != NULL)
delete [] pelem;
pelem = pelemTampon;
wNbElem++;
bResultat = VRAI;
}
return bResultat;
}
I use this class template in a cpp file like this
// OneFile.cpp
void RISyntaxeALCIDSICC::MemoriserGarniture (MOT16 &wIndice)
{
Vecteur<char> *povbGarniture;
Vecteur<Vecteur<char> *> ovpovbGarniture;
....
// Get some memory space
povbGarniture = new Vecteur<char>;
....
for (n = 0; n < nLong; n++)
{
// This call actually work
povbGarniture -> bInserer ((char) szTampon [n]);
}
....
// This call is generating the link error
ovpovbGarniture. bInserer (povbGarniture);
delete povbGarniture;
}
Why do I got this link error:
Error: Unresolved external 'Vecteur<Vecteur<char>*>::bInserer(Vecteur<char>*&,unsigned long)' referenced from module sas\RI Presentateur ALCIDSICC.cpp
Thanks in advance
Martin