I'm simply just trying to load an XML document into my C++ Console application using TinyXml2. However I keep getting errors which I'm not sure how to resolve. I'm new to c++ and I've attempted to follow the examples to the best of my knowledge. Why do i get these errors when attempting to load and xml? I've hard coding the path directly to the xml file.
I installed TinyXML2 and included into my project using the NuGetPackage manager. Here is my code..
#include "stdafx.h"
#include "tinyxml2.h"
#include <iostream>
using namespace tinyxml2;
using namespace std;
void LoadGraph(const char* xmlFilepath)
{
XMLDocument doc;
doc.LoadFile(xmlFilepath);
}
int main()
{
cout << "Loading file\n";
LoadGraph("C:/Users/Martini/Desktop/trash/graphTestings/testGraph.xml");
return 0;
}
The errors I keep getting are...
Severity Code Description Project File Line Error LNK1120 3 unresolved externals ExampleConsoleApp E:\Users\Martini\Projects\XML_Parsing\ExampleConsoleApp\Debug\ExampleConsoleApp.exe 1
Error LNK2019 unresolved external symbol "public: __thiscall tinyxml2::XMLDocument::XMLDocument(bool,enum tinyxml2::Whitespace)" (??0XMLDocument@tinyxml2@@QAE@_NW4Whitespace@1@@Z) referenced in function "void __cdecl LoadGraph(char const *)" (?LoadGraph@@YAXPBD@Z) ExampleConsoleApp E:\Users\Martini\Projects\XML_Parsing\ExampleConsoleApp\ExampleConsoleApp\ExampleConsoleApp.obj 1
Error LNK2019 unresolved external symbol "public: virtual __thiscall tinyxml2::XMLDocument::~XMLDocument(void)" (??1XMLDocument@tinyxml2@@UAE@XZ) referenced in function "void __cdecl LoadGraph(char const *)" (?LoadGraph@@YAXPBD@Z) ExampleConsoleApp E:\Users\Martini\Projects\XML_Parsing\ExampleConsoleApp\ExampleConsoleApp\ExampleConsoleApp.obj 1
Error LNK2019 unresolved external symbol "public: enum tinyxml2::XMLError __thiscall tinyxml2::XMLDocument::LoadFile(char const *)" (?LoadFile@XMLDocument@tinyxml2@@QAE?AW4XMLError@2@PBD@Z) referenced in function "void __cdecl LoadGraph(char const *)" (?LoadGraph@@YAXPBD@Z) ExampleConsoleApp E:\Users\Martini\Projects\XML_Parsing\ExampleConsoleApp\ExampleConsoleApp\ExampleConsoleApp.obj 1