Image

Imagethelosthoplite wrote in Imagecpp 😯confused

Hi, I'm not really a new joiner, this is just the new journal of an old member. Anyway, I'm now posting because I have a question concerning C++. I've had alot of problems with C++, being a 1.5 year veteran in Java.

I've been trying to use the Map class in the STL, but every time I try to use it, I get errors. Here's the problem:



#include
#include
#include "Location.h"

class GameManager
{
public:
GameManager()
{
};

private:
map
[Error: Irreparable invalid markup ('<string,location,less<location>') in entry. Owner must fix manually. Raw contents below.]

Hi, I'm not really a new joiner, this is just the new journal of an old member. Anyway, I'm now posting because I have a question concerning C++. I've had alot of problems with C++, being a 1.5 year veteran in Java.

I've been trying to use the Map class in the STL, but every time I try to use it, I get errors. Here's the problem:

<lj-cut text="The code and the problem">

#include <map>
#include <string>
#include "Location.h"

class GameManager
{
public:
GameManager()
{
};

private:
map<string,Location,less<Location>,alloc> locationMap;
};

--------------------------------------------------------------------------------------
The errors are:

13 "...`string' was not declared in this scope"
13 "...`less' was not declared in this scope"


I know that this isn't one small technical error, because I <i>really</i> can't say I know what I'm doing with C++, not yet. I would greatly appreciate if someone could contact me about how to properly use the STL. Thanks to all who can help.

</lj-cut>