[quote name='pulpfist' timestamp='1318032666' post='4870319']
That first error was a pretty good hint
Take a close look at this:
[color="#1C2837"][color="#880000"]#ifndef[color="#000000"] GAME_SIMULATION
[color="#880000"]#define[color="#000000"] GAME_SIMULAION
[color="#1C2837"][color="#000000"]edit:
[color="#1C2837"][color="#000000"]The error itself is actually quite obscure, but it basically indicates that the compiler has stumbled over a data type it doesn't recognize
Haha yeah I saw that and fixed it and smacked myself. Still getting errors though. I'm down to just two. Here they are:
1>c:\users\kev\desktop\game stuff\raknet stuff\raknettest\raknettest\netcode.cpp(100): error C2027: use of undefined type 'GameSimulation'
1> c:\users\kev\desktop\game stuff\raknet stuff\raknettest\raknettest\netcode.h(22) : see declaration of 'GameSimulation'
1>c:\users\kev\desktop\game stuff\raknet stuff\raknettest\raknettest\netcode.cpp(100): error C2228: left of '.addNewPlayer' must have class/struct/union
I've done a lot of moving things around, but basically I think my problem lies in NetCode.h because netcode.cpp still doesn't know anything about game but mysteriously doesn't have a problem with player. Here's the relevant chunk of code:
#include "Variables.h"
//#include "Player.h"
//#include "GameSimulation.h"
class GameSimulation;
class Player;
extern Player *newPlayer;
extern GameSimulation game;
class NetCode
{}
I don't understand why it needs me to include Variables.h again. You'll notice that I tried using extern in there but it has not fixed my issues.
[/quote]
Looks like netcode.cpp is trying to use the GameSimulation class from netcode.h, which is just a forward declaration.
Its a bit hard to understand how you want to connect things from just these snippets, but anyway, have you tried to include GameSimulation.h in netcode.cpp?
And where does newPlayer and game exists? The extern keyword tells the linker that they will be found in some other unit, but which?