Getting two link errors with my code provided below They are being generated by lines 38-46 I believe. I can't seem to find an issue...
1>AoE2Wide.obj : error LNK2020: unresolved token (0A000340) "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > AoE2Wide::Program::_gameDirectory" (?_gameDirectory@Program@AoE2Wide@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>AoE2Wide.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > AoE2Wide::Program::_gameDirectory" (?_gameDirectory@Program@AoE2Wide@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>C:\Users\Public\Documents\AOC Source\C++\AoE2Wide\Debug\AoE2Wide.exe : fatal error LNK1120: 2 unresolved externals
// AoE2Wide.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "AoE2Wide.h"
#include "Program.h"
#include "UserFeedback.h"
#include <iostream>
#include <string>
#include <direct.h> // used for game directory finding
//#using <mscorlib.dll>
void Go(void);
std::string FindGameDirectory(void);
int main(int argc, char* argv[])
{
try
{
Go();
}
catch (Exception ^e)
{
AoE2Wide::UserFeedback::Error(e);
}
AoE2Wide::UserFeedback::Close();
}
void Go(void)
{
using namespace AoE2Wide;
// call function above to find the game directory and store it in _gameDirectory
Program::_gameDirectory = FindGameDirectory();
}
std::string FindGameDirectory(void)
{
using namespace std;
AoE2Wide::UserFeedback::Trace("Locating game main folder...");
char * buffer;
if( (buffer = _getcwd( NULL, 0)) == NULL)
perror( "_getcwd error");
char language[500];
strcpy_s(language, buffer);
strcat_s(language, "\\language_x1.dll");
while (strlen(language) == 0)
{
throw gcnew AoE2Wide::FatalError("Cannot locate the proper directory. Please run the patch from the correct directory in the Age of Empires 2 Dirctory");
}
AoE2Wide::UserFeedback::Trace("Located the correct folder!");
return buffer;
}