Compiling SDL_image with MinGW

Started by
4 comments, last by thekie 15 years, 1 month ago
Hello everybody. I think iam not quite a beginner, but the following questions are beginner like. :) I have my new pc system set up now and want to install all the libs and dev tools i get used to. So i installed my code::blocks and SDL. First Question: Why is SDL_image not included to SDL? In my Ubuntu system it is and its fine. Its also pre compiled for the GNU compilers. Couse there is no precompiled version of SDL_image for MinGW i have to compile it by myself. I dont think i can use the libs compliled with VC++, do i? The next problem is there arent any procompiled libs for libz, zlib, libpng, libtiff or libjpeg for MinGW. And i find it quite hard to compile everything without propper makefiles or project files (in my case for code::blocks). I used VC++ in the early days and it was much easier to use libs with it, than wit is with MinGW. But VC++ is ijn my opinion not a good choice if u want to do a cross-plattformm game and its not free. ;) Has anyone some tips for me? How can I make this less stressfull? Thx. Kie.
Advertisement
Hi again,
i got a new Version of MinGW (http://nuwen.net/mingw.html) running with my codeblocks. Now everything is a bit easier to compile, beacause all libs needed for SDL_image are included, also is SDL itself.

After compiling SDL_image with my codeblocks to an dynamic link library ive got a SDL_image.dll and an libSDL_image.a whats fine!

I linked my SDL app against libSDL_image.a and out the SDL_image.dll in the working dir of my app. I added also the runtime dlls for the different file formats:

jpeg.dll
libpng12-0.dll
libtiff-3.dll
zlib1.dll

SDL.dll is of course in the same dir as well.

After starting my application nothing is shown, couse SDL_image is saying "Unsupported file format" via stderr.

I know i had this error the last time i installed SDL_image too, but i cant remeber the solution. Has anyone an idea?

Thx. Kie.
Okay i found a solution: I use the prebuild SDL_image.dll from http://www.libsdl.org/projects/SDL_image/ and my own libSDL_image.a.

I am not quite satisfied, couse i dont understand what was wrong with my dll file. Has anyone the patience to tell me?

Thx. Kie.
I believe you can use libs for VC just fine. Check here.
Also, you can write cross-platform code in visual studio, and the express editions are free even for commercial use.
Quote:Original post by thekie
Okay i found a solution: I use the prebuild SDL_image.dll from http://www.libsdl.org/projects/SDL_image/ and my own libSDL_image.a.

I am not quite satisfied, couse i dont understand what was wrong with my dll file. Has anyone the patience to tell me?

I vaguely seem to recall that you have to tell it which file types you want it to support.

Quote:Original post by Kylotan
Quote:Original post by thekie
Okay i found a solution: I use the prebuild SDL_image.dll from http://www.libsdl.org/projects/SDL_image/ and my own libSDL_image.a.

I am not quite satisfied, couse i dont understand what was wrong with my dll file. Has anyone the patience to tell me?

I vaguely seem to recall that you have to tell it which file types you want it to support.


Sorry cant follow you?

Do you mean i have to tell SDL_image which formats i want to use or do i have to tell MinGW which type of libs/dlls (?) i link against... *confused*

But thank you. :)

Kie.

This topic is closed to new replies.

Advertisement