Heeeelllooo... !
Okay, I have this pretty weird problem, or so I think
I have a CDLDAList Class, its declaration is:
Code:
template <class Type> class CDLDAList
{
private:
/**
* @brief Friend class declaration for CDLIterator
*/
template <class Type> friend class CDLIterator;
//..... declaration of private stuff
public:
/**
* @brief Default constructor
* @pre true
* @post Empty list constructed
*/
CDLDAList<Type>();
//.... rest of public thingies
}
and its constructor is defined as follows:
Code:
template <class Type> CDLDAList<Type>::CDLDAList<Type>()
{
nMaxIterators=100;
nIterators=0;
pHead=NULL;
pTail=NULL;
pIterators=new CDLIterator<Type>[nDeltaIterators];
nItems=0;
}
now I have another class which has an attribute of type CDLDAList<int>, like this:
Code:
class CFacade
{
private:
/**
* @brief List of Integers
*/
CDLDAList<int> lList;
//rest of class declaration
}
Now, trying to compile this, with two different compilers, gives different errors
With Visual Studio .NET 2003 it gives me linker errors saying none of CDLDAList<int>'s member functions I'm using could be found by the linker
Something among this line
Originally Posted by
Visual Studio
TallerListas1_09 error LNK2019: unresolved external symbol "public: __thiscall CDLDAList<int>::~CDLDAList<int>(void)" (??1?$CDLDAList@H@@QAE@XZ) referenced in function "public: __thiscall CFacade::~CFacade(void)" (??1CFacade@@QAE@XZ)
TallerListas1_09 error LNK2019: unresolved external symbol "public: bool __thiscall CDLDAList<int>::eraseItem(class CDLIterator<int>)" (?eraseItem@?$CDLDAList@H@@QAE_NV?$CDLIterator@H@@ @Z) referenced in function "public: enum Result __thiscall CFacade::srvEraseItem(class CDLIterator<int>)" (?srvEraseItem@CFacade@@QAE?AW4Result@@V?$CDLItera tor@H@@@Z)
and so on
--------------------------
Borland C++Builder 6.0 "stands" where I will make the text bold:
template <class Type> CDLDAList<Type>::CDLDAList<Type>()
{
//constructor code here
}
saying
Originally Posted by
Borland
[C++ Error] DLDAList.cpp(14): E2040 Declaration terminated incorrectly
Now, if I change it so it says template <class Type> CDLDAList<Type>::CDLDAList() instead, it will give me a linker error, just like MSVS.NET's, saying there's an unresolved external ( CDLDAList<int>::CDLDAList<int>() )
I dunno if I'm not following proper syntax or what, but I'm pretty confused about what to do and I think I'm doing it how it's supposed to be done... I dunno
Miguel Andrés