DevIL/OpenIL trouble loading pngs

Started by
7 comments, last by ill 14 years ago
I'm working on the game under Linux and can't seem to get the DevIL library to load png images. I can load them when my game is running in Windows no problem. On Linux I have to resort to TGA instead. I installed libpng12 and DevIL says it needs libpng to load png files. It still won't load. Anyone have any tips?
Advertisement
We used that library in the past and there were just too many problems with it so we eventually ditched it entirely and just used libpng and libjpeg directly. It says its cross-platform, but we found out that's not the case because it had some serious problems on OS X. This was a couple years ago and I don't know if things are better now, but I just thought I'd share our experiences on that library with you.

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

I have not used this library, but I wanted to mention that it's relatively easy to use libpng directly, as Roots suggested. If you know what you're doing, you can write the required code in half an hour or less.
Sounds like your package manager is installing devil without libpng support compiled in. It works as advertised on gentoo when emerged with the "png" USE flag. I suggest you compile your own devil (or ditch it, either's good).
I was compiling it manually with ./confgure and then make and make install.

I found out that I didn't have libpng-dev package installed. Once I did that it compiled with png support.

Only problem is I get an error now when I compile my game with the IL library. It says invalid reference to this one function that I didn't write down at the time.

When it compiles with libpng12 it says invalid reference to something like png_something_fnjump. I also tried installing libpng14 and when I did that it said there was an invalid reference to two functions. 1_2_4_8_to256 or something and some other function I forget the name of. Basically I'm right back where I was and am currently still using tga because I can't properly compile DevIL with png support on Ubuntu. I have 64 bit BTW if that matters.

When I have more time I'll reproduce the errors and write down the exact functions that it says are the problem.
Quote:Original post by illWhen it compiles with libpng12 it says invalid reference to something like png_something_fnjump. I also tried installing libpng14 and when I did that it said there was an invalid reference to two functions. 1_2_4_8_to256 or something and some other function I forget the name of.


Some deprecated functions and macros were removed in recent releases of libpng. You'll neet to either update your DevIL sources accordingly or just use an older version of libpng-1.2.

OK. I'll see if there's a newer version of DevIL. I checked recently and the same version I downloaded months ago is the one on the front page but I can do some closer digging. Also I'll look into finding an older libpng12 I guess.
Might i suggest SOIL?

very easy to work with, and i don't believe it has (m)any extentions.
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/
Wow interesting. I just looked at SOIL. It says it should work on Linux Windows and Mac, has integration with PhysicsFS which I currently use, and from what I see it won't have annoying png loading issues. I might switch over to SOIL in a bit.

BTW you should put a link for SOIL because it's very hard to Google something named SOIL hahah... DevIL wasn't so bad because somehow it was near the top even though devil is a pretty common word.

Aaaaanyway here's a link now...
http://www.lonesock.net/soil.html

This topic is closed to new replies.

Advertisement