Hello everybody,
I’m trying to create a Dictonary for my game:
and so I need TMap> s; to work
and it does work fine.
However when I try and initalise
Seeds = SetupSeeds();
It gives me the following error message:
Error 2 error LNK2001: unresolved external symbol “public: static class TMap<int,class TMap<class FString,class FString,class FDefaultSetAllocator,struct TDefaultMapKeyFuncs<class FString,class FString,0> >,class FDefaultSetAllocator,struct TDefaultMapKeyFuncs<int,class TMap<class FString,class FString,class FDefaultSetAllocator,struct TDefaultMapKeyFuncs<class FString,class FString,0> >,0> > MapTest::Seeds” (?Seeds@MapTest@@2V?$TMap@HV?$TMap@VFString@@V1@VFDefaultSetAllocator@@anonymous_user_15ea635e?$TDefaultMapKeyFuncs@VFString@@V1@$0A@@@@@VFDefaultSetAllocator@@anonymous_user_15ea635e?$TDefaultMapKeyFuncs@HV?$TMap@VFString@@V1@VFDefaultSetAllocator@@anonymous_user_15ea635e?$TDefaultMapKeyFuncs@VFString@@V1@$0A@@@@@$0A@@@@@A) E:\Wen Project\InventoryTests\Intermediate\ProjectFiles\MapTest.cpp.obj InventoryTests
//MAPTEST.CPP
#include "InventoryTests.h"
#include "Seed.h"
#include "MapTest.h"
MapTest::MapTest()
{
Seeds = SetupSeeds();
}
MapTest::~MapTest()
{
}
TMap<int, TMap<FString, FString>> MapTest::SetupSeeds()
{
// setup out seed data container
TMap<int, TMap<FString, FString>> s;
// Apple
TMap<FString, FString> d;
d.Add("label", "Apple Seed");
d.Add("amount_of_meshes", "3");
s.Add(0, d);
// Potato
TMap<FString, FString> e;
e.Add("label", "Potato Seed");
e.Add("amount_of_meshes", "3");
s.Add(1, e);
return s;
}
class ASeed* MapTest::Create(int seedTpye){
ASeed *seed = new ASeed();
seed->init(3, 2, "", "", "", 5, "", 1, "");
return seed;
}
//MAP TEST.h
#pragma once
enum SeedType{
Apple_Seed,
Potato_Seed,
};
class INVENTORYTESTS_API MapTest
{
public:
MapTest();
~MapTest();
static TMap<int, TMap<FString, FString>> Seeds;
static TMap<int, TMap<FString, FString>> SetupSeeds();
static class ASeed* Create(int seedTpye);
private:
};