ld.exe||cannot find -lSDL_image

i was learning sdl. and following the steps to install SDL_image from this site http://lazyfoo.net/SDL_tutorials/lesson03/windows/codeblocks/index.php and then suddenly this error showed up ld.exe||cannot find -lSDL_image . searched for a while but have no idea. help pls
Last edited on
if any of you guys wont help me i cant solve it myself. it is like i dont know how to swim and trying swim just by struggling that noone teaches me. keep wasting my energy and in the end i m drowning
so pls help me
Well, that's a linker error, and it's reporting that it can't find the SDL_image library. Which means one of two things:

1) The library isn't on your computer

2) The library is on your computer, but the linker can't find it - most likely, because the list of places to look for libraries in your project settings/makefile doesn't include the directory that contains that library.

And 43 minutes really isn't a very long time to have to wait for a response. Your bumping this thread was a little... premature.
well srry for being impatient

what i tried was to add SDL_image library to my compiler.
and i copied SDL_image.h which was inside include folder to CodeBlocks\MinGW\include\SDL

then i copied every file that is inside lib folder to CodeBlocks\MinGW\lib

after that i copied every .dll inside the bin folder to C:\Windows\System32

and i added -lSDL_image to the other linker options inside the linker settings tab

i did the same to the folder where i keep sdl files \SDL-1.2.15

the error is ld.exe||cannot find -lSDL_image|

where did i made a mistake everything seems fine to me
Is there not a standard installer for the SDL_image library? Or some installation instructions? That sounds like an awfully fiddly way of installing it.
well like i said in my first post i did as lazy foo told
http://lazyfoo.net/SDL_tutorials/lesson03/windows/codeblocks/index.php
Did you do as he said here?
http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.php

In order for your program to compile, the compiler needs to find two things:
- the SDL_whatever.h files
- the libSDL_whatever.a files

If you installed Code::Blocks with the bundled GCC compiler, then you can do it several ways. The Lazy Foo' tutorials have you tell C::B where to find those files on disk where you extracted them from the .zip. If you delete or move the directory afterwards then GCC won't be able to find it.

The other way is to copy them into C:\MinGW\include and C:\MinGW\lib, respectively. (I'm not sure where C::B puts the GCC. It might be in C:\Program Files\Code Blocks\MinGW or something like that.)

Once you have that done, then the GCC can actually find the files.

Hope this helps.
well i went on rampage and deleted and removed everything about sdl and c::b.
then reinstall all and it went perfect everything worked. ty for all your help
Although this is solved, I believe Code Blocks doesn't keep the compiler anywhere, you're supposed to install MinGW on your own, then install Code Blocks.
well there is a c::b with mingw bundled
Last edited on
You obviously haven't visited the Code::Blocks downloads page. They have, AFAIK, always provided a version with MinGW bundled.
http://www.codeblocks.org/downloads/26#windows
Topic archived. No new replies allowed.