[SDL] forward decleration problem

Kostas Kostiadis kos at climaxgroup.com
Fri Jan 7 04:15:08 PST 2005


Hello all,

I have a header that has pointers to SDL_MouseMotionEvent and
SDL_MouseButtonEvent,
so at the top of the header I'm trying to forward declare these (then in the
.cpp I include the
appropriate header).

I have tried both

struct SDL_MouseMotionEvent; and
typedef struct MouseMotionEvent;

but I keep getting these when using the GCC compiler:

In file included from Lib/Control/InputManager.cpp:11:
Lib/Control/InputManager.h:18: error: conflicting declaration 'struct
SDL_MouseMotionEvent'
/usr/include/SDL/SDL_events.h:131: error: 'SDL_MouseMotionEvent' has a
previous declaration as `typedef struct SDL_MouseMotionEvent
SDL_MouseMotionEvent'
Lib/Control/InputManager.h:19: error: conflicting declaration 'struct
SDL_MouseButtonEvent'
/usr/include/SDL/SDL_events.h:140: error: 'SDL_MouseButtonEvent' has a
previous declaration as `typedef struct SDL_MouseButtonEvent
SDL_MouseButtonEvent'

Any ideas?

cheers,
K.







More information about the SDL mailing list