C
clus.aol.com
//File Trains.h
#include <string>
class Trains
{
public:
static std:string haveToWash;
std::string getTrain ();
};
//File Trains.cpp
#include "StdAfx.h"
#include "Trains.h"
#include <string>
std::string Trains::getTrain()
{
return haveToWash;
}
//File with main routine
#include "StdAfs.h"
#include <string>
int main (int argc, _TCHAR* argv[])
{
return 0;
}
Build Error:
1>Trains.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Trains::havetoWash"(?haveToWash@Trains@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
#include <string>
class Trains
{
public:
static std:string haveToWash;
std::string getTrain ();
};
//File Trains.cpp
#include "StdAfx.h"
#include "Trains.h"
#include <string>
std::string Trains::getTrain()
{
return haveToWash;
}
//File with main routine
#include "StdAfs.h"
#include <string>
int main (int argc, _TCHAR* argv[])
{
return 0;
}
Build Error:
1>Trains.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Trains::havetoWash"(?haveToWash@Trains@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)