SDL_mixer problem

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
darkness
Posts: 121
Joined: Sun Jun 15, 2008 8:42 pm

SDL_mixer problem

Post by darkness »

Excuse me, I've tryied to write a simple music player with SDL_mixer, but when I've try to compile the project I've a lot of errors, what lib I've to include?

Code: Select all

undefined reference to `SDL_LoadWAV_RW'
undefined reference to `SDL_FreeWAV'
undefined reference to `SDL_FreeWAV'
undefined reference to `SDL_MixAudio'
undefined reference to `SDL_MixAudio'
undefined reference to `ov_time_seek'
undefined reference to `ov_clear'
undefined reference to `SDL_MixAudio'
undefined reference to `ov_read'
undefined reference to `ov_info'
undefined reference to `ov_open_callbacks'
undefined reference to `ov_open'
undefined reference to `SDL_MixAudio'
undefined reference to `ov_open_callbacks'
undefined reference to `ov_info'
undefined reference to `ov_pcm_total'
undefined reference to `ov_read'
undefined reference to `ov_read'
undefined reference to `ov_clear'
And here is the lib that I've linked:

Code: Select all

LIBS =  -lSDL -lSDL_image -lSDL_gfx -logg -lvorbis -lsmpeg -lmikmod -lSDL_mixer -lpspgum -lpspgu -lpng -lz -lm -lpspumd \
	-lpspusb -lpspusbstor -lpsppower -lpsprtc -lpspusbdevice \
	-lpspsystemctrl_user -lpspkubridge -ljpeg -lpsphprm -lpspaudiolib \
	-lpspaudio -lmad
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

lvorbisidec
darkness
Posts: 121
Joined: Sun Jun 15, 2008 8:42 pm

Post by darkness »

Ok, thanks! All resolved! ( i think )
darkness
Posts: 121
Joined: Sun Jun 15, 2008 8:42 pm

Post by darkness »

Excuse me, I've a new error :(...
I've tryied to load a simple MP3 but I've have ever error "Module format not recognized"...
But the file is not corrupted, if I try to load it with another MP3 player the file is correctly loaded!!!

Code: Select all

Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, 2, 4096*3 );
    
    Mix_Music *music = NULL; 
    
    music = Mix_LoadMUS(target);
    
    if(music == NULL)
    {
        Init();
        printf("\nError: %s", Mix_GetError());
        sleep(2000000);
    }
    
    Mix_PlayMusic( music, -1 );
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

darkness wrote:Excuse me, I've a new error :(...
I've tryied to load a simple MP3 but I've have ever error "Module format not recognized"...
But the file is not corrupted, if I try to load it with another MP3 player the file is correctly loaded!!!

Code: Select all

Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, 2, 4096*3 );
    
    Mix_Music *music = NULL; 
    
    music = Mix_LoadMUS(target);
    
    if(music == NULL)
    {
        Init();
        printf("\nError: %s", Mix_GetError());
        sleep(2000000);
    }
    
    Mix_PlayMusic( music, -1 );
SDL_Mixer doesn't recognize mp3 unless you compile it along with SMPEG, which requires your app to be C++ as SMPEG is C++. So you either use C++ for ALL your SDL apps, or use something other than mixer to play mp3.
Post Reply