Problem with the libpng.... - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Problem with the libpng.... (/thread-6005.html)
Problem with the libpng.... - Shogun - Dec 31, 2004 07:48 PM
Hi everyone, I'm using the terminal to compile my sdl (using the stuff from X11) programs written in C++. I'm using the sdl-config script to compile the programs and today I decided it was a good idea to try to use a png instead of a bmp since I like the idea of having transparant parts of an image. So I looked into the sdl docummentation and found the SDL_image library, however when I tried to compile it with:
But this gave me a number of undefined symbols
Here I included the libpng and libjpeg librarys, and everything works fine untill I tried to statically link it with:
This however gave me the error:
Then I tried to use the libpng-config script the same way as I use the sdl-config one (since I couldn't find any matrial on how you use it)
But this gave me:
After this I pretty much ran out of ideas. So I'm wondering how you're supposed to do this probably?
Oh and I'm sorry for making such a long post, I'm used to post at a forum where you have to say exactly what you've tried and what you use to compile.
Problem with the libpng.... - OneSadCookie - Dec 31, 2004 11:26 PM
Don't apologize, it's nice to see a post for once where there's enough information provided to help -- too often it's "I can't compile SDL programs help"
anyway, rather than trying to use the libpng config script, just add
to your link line. That should fix things
Problem with the libpng.... - Shogun - Jan 1, 2005 06:19 AM
This works, how ever I wounder if I want to link it statically shouldn't I do so with the libz as well?
Problem with the libpng.... - OneSadCookie - Jan 1, 2005 10:58 AM
You can if you want, but I don't know why you'd want...
If you want to do that, you'll need to download the libz source, build it yourself, then rebuild libpng making sure that it links against your new static libz rather than the system's dynamic libz. Probably you'll have to edit the Makefile to accomplish that.
Also, watch out for the LGPL, statically linking SDL. You seem pretty clued up, so probably you've already realized the consequences of that, but I thought I should point it out
Problem with the libpng.... - Shogun - Jan 1, 2005 01:01 PM
yeah, ok, thanks for your help, I think I'll stick with the dynamical one, a bit to much work the other way around I'm afraid.