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

SDL_image AND Dev-C++ ???!???

Started by DarkSilver Apr 27, 2002 at 2:48 PM 3 replies 1.7k views
Original Post
DarkSilver
DarkSilver
Hello, thanks to the tuts of marius, i''ve found how to make SDL with Dev-C++ (because on libsdl.org, there is only the version for VC+ for windows) But i want to use the librarie SDL_image now! it works with VC6, but not with Dev-C++ (i have the 4.01) and i don''t know how to make it works somebody can help me??? please!! tanks a lot
Null and Void
Null and Void
Recompile SDL_image on your own, it''s open source after all.

DarkSilver
DarkSilver
and after?
i take the source, i compile, and how i use it after???
and above all, i''m not sure if i can compil it....

is there any "zip" with the files needed by devcpp like the "sdlDevCPP-1.2.3.zip" of marius in his tuts ?
smilydon
smilydon
Null and void is right, you have to compile it yourself. What you want to have is a libSDL_image.a file that can be linked in your project such that the executable will call the functions in DDL_image.dll.
Borland''s free commandline tools are provided with a tool that let you generate the lib from the dll. I have not found a way to do this for the mingw compiler, so you have to do this yourself (i was planning to do this of SDL_image after i did it for SDL_ttf, but i had other things to do.)

In this thread i explain how i did it for SDL_ttf. The problem was a bug in dev-c++, making it not include the linked libraries to dllwrap, so you have to generate a makefile and run make....

SDL_image is a bit more complicated to do because you also need to include zlib and pnglib, for which you have to generate libfiles as well. I hope somebody out there generated these because it seems like a lot of work....
smilydon
smilydon
hahaha, gotit....

You can create the import library from the dll. First you have to download pexports. This can be used to generate a def file. There are tricky bits with underscores when you apply this to a dll with stdcalls because of the number of underscores. Fortunatly you don''t have to worry about it when you apply it to SDL_image.dll.
I dumped pexports in the bin directory of dev-c++.....

You can do in a console:

C:\Dev-C++\Bin\pexports SDL_image.dll > SDL_image.def

In the bin directory of dev-c++ there is a dlltool, which takes the def file and creates an import library. You can do:

C:\Dev-C++\Bin\dlltool -d SDL_image.def -l libSDL_image.a

That''s it. You can link the libSDL-image.a in the project option after lmingw32 -lSDLmain -lSDL. If you place the library in the lib directory of dev-c++ you can add -lSDL_image.

I tested this by compiling the showimage.c from the source distribution of SDL_image and it works!!!!


Topic Locked

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

Sign in to reply to this topic.