sdl audio linker error

Started by
1 comment, last by SKATIN_HARD 18 years, 3 months ago
Hello again. I am getting a weird linker error for sdl_mixer code. The code is:
[sourcecpp]

   if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 1024)==-1) {
               fprintf(stderr,"No audio opened", Mix_GetError());
                       return 1;
                       } 
I get a error stating:[Linker error] undefined reference to `Mix_OpenAudio' I have already included sdl_mixer.h at the top of the file. Does anybody have any idea why I am getting this linker error? Thanks.
Advertisement
You need to link in SDL_Mixer as well [wink]

-lsdl_mixer
Thanks Drew. That did the trick. Funny how I could always forget the simple stuff like that.

This topic is closed to new replies.

Advertisement