Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL libraries

Started by nullsquared Sep 4, 2005 at 10:13 AM 4 replies 950+ views
Original Post
nullsquared
nullsquared
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.
Koshmaar
Koshmaar
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.
SiCrane
SiCrane
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.
nullsquared
nullsquared
Thanks. For some reason I'm lazy today so I just grabbed the header and started to do nothing. LOL thanks again.
Peregrin
Peregrin
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.
Jooleem. Get addicted.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.