SDL: Undefined reference to IMG_LOAD [Solved]
By nick | Code30 Nov 2011
If you’re trying to get SDL_Image to work correctly and are getting the following error:
undefined reference to `IMG_Load`
Here’s how to fix it:
Go to your compiler link options, in code and add
-lSDL_image

it doesnot work i have tried
Still don’t work! What shod i do?
cry!
OK it worked very well, but you’re pointing to another file which I couldn’t find “-lSDL_image” or “lSDL_image”
I could only find SDL_image under the lib directory
anyway thank you!
Thanks for your feedback, glad you got it working in the end!
Solution: If you are using a 64bit computer, make sure to use the SDL_Image files from the >x86 folder< NOT THE X64!
Thanks for that, I’m sure others will also appreciate this
Hey. I have the problem “The program cant start because SDL_image.dll is missing from your computer. Try reinstalling the program to fix this problem”
Any thing you can suggest I can do?
Your Sincerly Kalle
Hi,
You need to head over to http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip extract the file named “SDL_image.dll” into the directory of the program you’re trying to run and hopefully things will work!
Issued solved by this post.
Place the SDL_Image.lib file from the x86 folder into the C:\SDL-1.2.15\lib.
thank you worked great however codeblocks doesnt need the -l option it adds it auto matically