Jump to content
  • Advertisement
Sign in to follow this  

SDL libraries

This topic is 4642 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

Hi all... ummm I'm new to SDL and I made this little game with moving people in a simple background, but I wanted to use other formats other than BMPs for the background... So I saw this SDL_image.h(I think) file and included it, and then I get an this: undefined (Linker error) linking to Load_IMG??? It also happens when I add SDL_mixer.h and other SDL extesnions... Sorry if this is really easy, I just dont know... thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
You have to link with SDL_Image, in the same way that you're linking with SDL.

So, if you're using GCC/MinGW, add -lSDL_Image, and if you're using Visual Studio, add SDL_Image.lib to Project properties->Linker. You may also need to add directories with those linker files, to compiler's library search path.

Share this post


Link to post
Share on other sites
In order to use additional SDL libraries you need to download the whole library not just the headers. For example, you can go to the SDL_image page, get the development package, and add SDL_image.h to your included headers and SDL_image.lib to your libraries. For a more detailed response you might want to mention what compiler you are using.

Share this post


Link to post
Share on other sites
Also note that, assuming you are using Windows, you will need to place the relevant DLLs (in this case SDL_image.dll), where they can be accessed by the executable you create. This means either copying them to a folder that's in your system's path (e.g. C:\Windows\system32), or placing them in the same folder as your executable.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!