xCode: .. was not declared in this scope

Go down

xCode: .. was not declared in this scope Empty xCode: .. was not declared in this scope

Post  oioioi on Thu Jun 25, 2009 12:19 pm

I got a struct named weapon_t in weapons.h file, inside game.h I have a struct that contain weapon_t, normally this works fine as long as I include weapons.h but now it doesn't. xCode gives me this error: "Error: 'weapon_t' does not name a type". I have tried including the file different way for almost an hour, but it just doesn't work. here is some of the code:

#ifndef WEAPONS_H
#define WEAPONS_H

#include "template.h"

#define MAX_WEAPONS 2

typedef struct
   unsigned char firemode;
   int ammo, maxammo;
   float recoil, accuracy, accuracy2;
   float reloadTime, reloadTimer;
   bool enable;
} weapon_t;

typedef enum



#ifndef GAME_H
#define GAME_H
#include "template.h"

typedef struct
   SIO2object *obj, *gunObj;
   float life;
   float rotx, rotz;
   weapon_t weapons2[2];
   int wep;
} player_t;


template.h includes all files in the project, I have also tried including only the necessary files in every header file. This occur every time my project is starting to have many files. Do I include header files wrong?



Posts : 136
Join date : 2008-12-02
Location : Norway

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum