Jump to content
  • Advertisement
Sign in to follow this  
Purkinje

How to use SDL_mixer with Visual Studio 2010?

This topic is 2465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use SDL_mixer to give my SDL game some background music. I downloaded the source zip from here, and extracted the SDL_mixer-1.2.11 directory into my Program Files(x86) directory. In Visual Studio project properties, under Configuration Properties, then VC++ Directories, I added the SDL_mixer directory to the Include Directories and to the Library Directories. This is the same thing I did to get SDL itself working in Visual Studio.

However, there was also another thing I did with SDL that I'm not able to do with SDL_mixer. When I set up SDL, I went to Configuration Properties, then Linker, then to Input. There, I added SDLmain.lib and SDL.lib to Additional Dependencies. I would do the same for SDL_mixer, but I can't find any .lib files in the SDL_mixer directory or its subdirectories.

When I try to compile my project, I get the following errors:



1>CApp_OnCleanup.obj : error LNK2019: unresolved external symbol _Mix_CloseAudio referenced in function "public: void __thiscall CApp::OnCleanup(void)" (?OnCleanup@CApp@@QAEXXZ)
1>CApp_OnInit.obj : error LNK2019: unresolved external symbol _Mix_OpenAudio referenced in function "public: bool __thiscall CApp::OnInit(void)" (?OnInit@CApp@@QAE_NXZ)
1>CSoundBank.obj : error LNK2019: unresolved external symbol _Mix_LoadWAV_RW referenced in function "public: int __thiscall CSoundBank::OnSoundLoad(char *)" (?OnSoundLoad@CSoundBank@@QAEHPAD@Z)
1>CSoundBank.obj : error LNK2019: unresolved external symbol _Mix_FreeChunk referenced in function "public: void __thiscall CSoundBank::OnSoundCleanup(void)" (?OnSoundCleanup@CSoundBank@@QAEXXZ)
1>CSoundBank.obj : error LNK2019: unresolved external symbol _Mix_PlayChannelTimed referenced in function "public: void __thiscall CSoundBank::Play(int)" (?Play@CSoundBank@@QAEXH@Z)
1>C:\Users\Nathan\Documents\Visual Studio 2010\Projects\SDL Game\Debug\SDL Game.exe : fatal error LNK1120: 5 unresolved externals


Should I be using the binaries instead of the source?

Attached is my project code (.cpp and .h files).

Thanks a lot for your help!

EDIT: I found the .lib file I need in the VC version of SDL_mixer. This post can be closed or binned as mods deem necessary.

Share this post


Link to post
Share on other sites
Advertisement
make sure you have the dll's in the right place, and in the library include part you need to have SDL.lib; SDL_mixer.lib

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!