Unresolved external symbol using STL vector reference
I get an "Unresolved external symbol" (LNK2019 in .NET) when I use a reference to STL vector as return type of a method. Both definition and declaration of method are in separated files. If I don't use a reference, all compile and link ok. What can be happend?
The prototype of method (.h file):
Code:
class CON_CConsoleOutput
{
private:
vector<string> m_vsOutputLines;
public:
...
vector<string>& GetOutputLines();
...
};
The definition in cpp file:
Code:
vector<string>& CON_CConsoleOutput::GetOutputLines()
{
return m_vsOutputLines;
}
If I removed reference, it works. Could be a syntaxis problem?