I must be doing something really obvious wrong…and i appologise in advance
if i am being stupid but basically i have a struct that is part of the gfx
engine header file which looks like this:
// watch for multiple inclusions
#ifndef GFX_h
#define GFX_h
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include
#include “Main2.h”
struct Animation_Object
{
std::vector<SDL_Surface*> _animation;
std::vector _delays;
int _currentAnim; //What current animation are we playing?
long _timeStartedPlaying; //When did animation start playing?
};
and i am trying to use it in my game header file which looks like this:
// watch for multiple inclusions
#ifndef GAME_h
#define GAME_h
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include
#include “Main2.h”
#define NUMBEROFMONSTERS 10
struct Collison_Object
{
Animation_Object _animation_Object;
SDL_Rect _coords;
SDL_Rect _rotCoords;
SDL_Rect _collisionArea;
SDL_Surface *surface;
SDL_Surface *rotSurface;
double rotateValue;
int alphaValue;
int offsetx,offsety; //Offset used to find centre of objects
};
(Note that main2.h is where everthing is being linke together):
// watch for multiple inclusions
#ifndef Main2_h
#define Main2_h
#include “SDL_mixer.h” //Used to load in music
#include “SDL_image.h” //Used to load in non bmp images
#include “SDL.h”
#include “Intro.h”
#include “Game.h”
#include “GraphicsEngine.h”
yet when i go to compile it says:
c:\documents and settings\darkplastic\desktop!!game\game\Game.h(31) : error
C2146: syntax error : missing ‘;’ before identifier '_animation_Object’
c:\documents and settings\darkplastic\desktop!!game\game\Game.h(31) : error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
c:\documents and settings\darkplastic\desktop!!game\game\Game.h(31) : error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
as if it cant see the Animation_object in the graphics engine header
file…i am very confused by this any suggestions? Cheers.
-James–
View this message in context: http://www.nabble.com/Silly-c%2B%2B-question-tf2116165.html#a5835104
Sent from the SDL forum at Nabble.com.