SDL IMG_Load

Started by
27 comments, last by password 18 years ago
Sorry, didn't understand that it was supposed to be a l instead of an i. Anyways the error disappeared now, but it says that it doesn't exists instead (linker error).

That's really strange because it didn't say that when the paramter was "i", which is the one that should return that message. Now when the right parameter is in place it returns the doesn't exist error, really odd.
Advertisement
Quote:Original post by password
Sorry, didn't understand that it was supposed to be a l instead of an i. Anyways the error disappeared now, but it says that it doesn't exists instead (linker error).

That's really strange because it didn't say that when the paramter was "i", which is the one that should return that message. Now when the right parameter is in place it returns the doesn't exist error, really odd.


you forgot this step:
Quote:From the tutorial
Next extract the lib file that's inside of lib subfolder of the archive to the Dev C++ lib folder.

The Dev C++ lib folder should be at C:\Dev-Cpp\lib.


and it's not strange. The first time it was complaining that you never told it where the function was (which is what a lib file does), and now it's complaining it can't find the lib file you're trying to link against.

Learn to make games with my SDL 2 Tutorials

I have already extracted all files including the lib file (SDL_image.lib).
copy/paste the error as it appears in the compiler.

Learn to make games with my SDL 2 Tutorials

C:\DEV-C_~1\Bin\ld.exe: cannot open -lSDL_image: No such file or directory
that means SDL_image.lib is not in C:\DEV-C_~1\lib or you put -l-lSDL_image

double check.

Learn to make games with my SDL 2 Tutorials

Does mingw load <whatever>.lib files with the -l parameter? I thought it only loaded lib<whatever>.a files, maybe Im wrong.

For SDL_Image, I've always used the file libSDL_image.a (not SDL_image.lib, i may have downloaded a devpack or compiled it myself, i can't remember, i installed it long ago...) and have never had problems. For .lib's I've always added the full path (eg: whatever/dev-cpp/lib/foo.lib instead of -lfoo or if the file was libfoo.a i use -lfoo).
Quote:Original post by Lazy Foo
that means SDL_image.lib is not in C:\DEV-C_~1\lib or you put -l-lSDL_image

double check.


Maybe he DOES have THAT, but that won't matter. He probably doesn't have libSDL_Image.a.

[grin][wink]
In my /DevCpp/lib dir, I have the files "SDL_ttf.lib" AND "libSDL_image.a" and both of them work the exact same way in the parameters tab - that is, I use -lSDL_ttf -lSDL_image. Works fine.
It only takes one mistake to wake up dead the next morning.
I can test the libSDL_image.a file if you say that is working, but where can I get it?

This topic is closed to new replies.

Advertisement