Linking smpeg2 statically


I’m trying to get rid of the smpeg2.dll file.

After downloading the SDL_Mixer and making a small program to play music, it works as long as smpeg2.dll is in the file path.

After running ./configure, make, & make install without any errors, then linking smpeg2.a to my project, the DLL file is still required.

I’m assuming I’m probably just missing a compiler option somewhere – what might it be?


Or the better question would be…

Can I remove smpeg2.dll all together?
It appears as I use Mix_LoadMUS, it uses this DLL for MP3 formats.
I’m not going to use MP3s anyways. How can I prevent this message?


DLLs are only loaded dynamically when needed. This happens when you try to load / play a music file that needs it, or when you call Mix_Init with flags.

If you want to static link, you’ll need to compile the SDL_mixer source into your project, and not link any of the libraries. The binary libraries provided are just to link to the DLLs. It’s recommended you just include the DLLs with your build. End users don’t really care how many files are bundled with your install.


Thanks for the reply.
I understand I could just use the DLL, however I chose SDL’s mixer library in order to stay away from it (SFML statically built still depends on openal32.dll)

I compiled SDL_mixer’s source and linked it statically which works fine.
In SDL_mixer’s external folder, I see smpeg which can be built similarly. When I build it and get a .a file, I link it to my project, and it still pops up a message wanting smpeg2.dll

What am I doing wrong that it still required the DLL?