Linker Error: LNK2001 With This Visual Studio Project

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top