Error Compiling SDL_mixer

My compiler ( Borland Builder 6 ) gives an error with this union :

struct _Mix_Music {
Mix_MusicType type;
union {
#ifdef CMD_MUSIC
MusicCMD *cmd;
#endif
#ifdef WAV_MUSIC
WAVStream *wave;
#endif
#ifdef MOD_MUSIC
UNIMOD *module;
#endif
#ifdef MID_MUSIC
#ifdef USE_TIMIDITY_MIDI
MidiSong *midi;
#endif
#ifdef USE_NATIVE_MIDI
NativeMidiSong *nativemidi;
#endif
#endif
#ifdef OGG_MUSIC
OGG_music *ogg;
#endif
#ifdef MP3_MUSIC
SMPEG *mp3;
#endif
} data;
Mix_Fading fading;
int fade_step;
int fade_steps;
int error;

The error message :
[C++ Error] music.c(115): E2453 Size of the type ‘union’ is unknown or zero

Dinand Vanvelzen wrote:

My compiler ( Borland Builder 6 ) gives an error with this union :

struct _Mix_Music {
Mix_MusicType type;
union {
#ifdef CMD_MUSIC
MusicCMD *cmd;
#endif
#ifdef WAV_MUSIC
WAVStream *wave;
#endif
#ifdef MOD_MUSIC
UNIMOD *module;
#endif
#ifdef MID_MUSIC
#ifdef USE_TIMIDITY_MIDI
MidiSong *midi;
#endif
#ifdef USE_NATIVE_MIDI
NativeMidiSong *nativemidi;
#endif
#endif
#ifdef OGG_MUSIC
OGG_music *ogg;
#endif
#ifdef MP3_MUSIC
SMPEG *mp3;
#endif
} data;
Mix_Fading fading;
int fade_step;
int fade_steps;
int error;

The error message :
[C++ Error] music.c(115): E2453 Size of the type ‘union’ is unknown or zero

sounds like none of those #ifdef’s are #defined
perhaps if you copied config.h.in to config.h and editted that, #defining the features that you can support…
normally people in the *NIX-like world use the configure script to do this…
I dunno how non-*NIX people normally work this out, but this is what I’d do in a bind.–
-==-
Jon Atkins
http://jonatkins.org/