0

Inside UIHandling.h:

enum eType{...};

class UIHandling : public exception
{
...
UIHandling(eType);
template <class T>  
UIHandling(eType, T);
...
}

Inside another file CompaniesMap I call the second constructor many times using different enums and second variables of different types (double, unsigned int, eType, etc...)

I get the following errors:

1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<double>(enum eType,double)" (??$?0N@UIHandling@@QAE@W4eType@@N@Z) referenced in function __catch$?addCompany@CompaniesMap@@UAEXXZ$2
1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<__int64>(enum eType,__int64)" (??$?0_J@UIHandling@@QAE@W4eType@@_J@Z) referenced in function __catch$?addCompany@CompaniesMap@@UAEXXZ$4
1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<unsigned int>(enum eType,unsigned int)" (??$?0I@UIHandling@@QAE@W4eType@@I@Z) referenced in function __catch$?changeHoldingAmount@CompaniesMap@@UAEXXZ$0
1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<class Date>(enum eType,class Date)" (??$?0VDate@@@UIHandling@@QAE@W4eType@@VDate@@@Z) referenced in function "public: virtual void __thiscall CompaniesMap::postponeExpiryDate(void)" (?postponeExpiryDate@CompaniesMap@@UAEXXZ)
1>D:\Asaf\C\VS\hw5\HW5\Debug\HW5.exe : fatal error LNK1120: 5 unresolved externals

Do I need to define the class itself to be a template? If so than why? If not, why do the errors appear?

asaf92
  • 1,557
  • 1
  • 19
  • 30

0 Answers0