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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top