I'm entirely dumb-founded as how to address this because I get one of 2 errors:
error: ISO C++ forbids declaration of `Player' with no type|
multiple definition of `...'|
This is how things are layed out (sliced from code):
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//Server.h
#pragma once
#include <climits>
#include <vector>
#include "39dll/39dll.h"
#include "Player.h"
class Server
{
public:
staticint MAX_PLAYERS;
static Player** Players; //This errors, relies on Player.h
static vector<CSocket*> Queue //This errors, relies on 39dll.h;
};
1 2 3 4 5 6 7 8 9
//Player.h
#pragma once
#include "Server.h"
class Player
{
public:
CSocket* socket; //This errors, relies on the header 39dll.h in Server.h
};
So basically these headers need each other, the class types are messing each other up by either not being defined, or re-defining.
Just put class CSocket; in front of the player class instead of including the header, and put class Player; and class CSocket; in front of the Server class and remove the includes.