Sign in to follow this  
WiredCat

X does not name a type/ circular reference

Recommended Posts

I bet its circular reference but please when i include a definition of X then it should compile and run anyway.

#ifndef game_initH
#define game_initH
#include "logme.h"
#include "globalvars.h"

#include "stdlib.h"
#include "sim/ocean.h"
#include "string.h"
#include "Textures.h"


#include "sim/ships/battle_mp.h"

//#include "sim/ships/ship.h"
#include "Timer.h"

#include "shaderclass.h"

#include "HUD/HUD.h"
#include "HUD/menu/menulist.h"
#include "sim/Entity.h"
const int viewport_size = 128;

extern TBattleMP_Frame * GAME_PLAY; < -- TBattleMP_Frame does not name a type

 

and in battle_mp.h 


struct TBattleMP_Frame
{
};

 

 

 

why it is even throwing me errors. That shouldnt occur :)

Share this post


Link to post
Share on other sites

The "struct TBattleMP_Frame { ..}" definition should become for the "extern" line that uses it, in that case.

 

As an alternative, you can also declare the struct

struct TBattleMP_Frame;

extern TBattleMP_Frame * GAME_PLAY;

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this