xCode: .. was not declared in this scope
xCode: .. was not declared in this scope
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:
Thanks!
- Code:
//weapons.h
#ifndef WEAPONS_H
#define WEAPONS_H
#include "template.h"
#define WEAPON_MAX_NAME_LENGHT 20
#define MAX_WEAPONS 2
typedef struct
{
char name[WEAPON_MAX_NAME_LENGHT];
unsigned char firemode;
int ammo, maxammo;
float recoil, accuracy, accuracy2;
float reloadTime, reloadTimer;
bool enable;
} weapon_t;
typedef enum
{
SEMIAUTO,
AUTO
} WEAPON_FIRE_MODE;
...
#endif
- Code:
//game.h
#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;
...
#endif
Thanks!
oioioi- Posts : 136
Join date : 2008-12-02
Location : Norway
![-](https://2img.net/i/empty.gif)
» template.xcodeproj revision*
» need help to setup sio2 sdk in xcode
» Snow leopard & Xcode 3.2
» Adding SIO2 to an existing Xcode iPhone project
» need help to setup sio2 sdk in xcode
» Snow leopard & Xcode 3.2
» Adding SIO2 to an existing Xcode iPhone project
Permissions in this forum:
You cannot reply to topics in this forum