3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by CppBuilder2006
0

nothing!
I have deleted almost every thing.
after I added the template function val(), the linker errors appeared.
I only want to know why I receive a linker error.

the error:

Error 1 error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl val<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$val@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV01@@Z) referenced in function "public: void __thiscall BaseList::Add(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?Add@BaseList@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) list.obj

0

try adding the following code in the very beginning.

#include <string>
using std::string;

this is the solution I can suggest without looking at the .zip file :)
Hope this helps.
Good luck.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.