A
A L
Hi,
I am getting this linker error:
error LNK2019: unresolved external symbol "public: static class
std::vector<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > &
__cdecl ......
I have a static std::vector<std::string> member in the private section
of my class. I am initializing/defining this static member in my cpp
file like this:
std::vector<std::string> MyClass::myStaticMember_ ;
then I have a function that returns a reference to the above vector:
std::vector<std::string> &myFunction()
{
return myStaticMember_;
}
I am using this function in my main code like this:
std::vector<std::string> &myStrings = MyClass::myFunction();
I am using Visual Studio 2008 Team System.
Any help?
I am getting this linker error:
error LNK2019: unresolved external symbol "public: static class
std::vector<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > &
__cdecl ......
I have a static std::vector<std::string> member in the private section
of my class. I am initializing/defining this static member in my cpp
file like this:
std::vector<std::string> MyClass::myStaticMember_ ;
then I have a function that returns a reference to the above vector:
std::vector<std::string> &myFunction()
{
return myStaticMember_;
}
I am using this function in my main code like this:
std::vector<std::string> &myStrings = MyClass::myFunction();
I am using Visual Studio 2008 Team System.
Any help?