LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Build problem hard to solve : zeroradiant and libpng 1.4 (libpng compatibility pb) (http://www.linuxquestions.org/questions/linux-software-2/build-problem-hard-to-solve-zeroradiant-and-libpng-1-4-libpng-compatibility-pb-853530/)

naaman 01-01-2011 02:11 AM

Build problem hard to solve : zeroradiant and libpng 1.4 (libpng compatibility pb)
 
Hello !

I'd like to build Zeroradiant (1.6) but I've got a problem to compile it...
Indeed, Zeroradiant only works with libpng 1.2.X (which is not compatible with libpng 1.4.X ...). Then when I start compiling the sources I got this typical error :
Code:

plugins/imagepng/plugin.cpp: In function 'void LoadImage(const char*, unsigned char**, int*, int*)':
plugins/imagepng/plugin.cpp:140: error: 'png_voidp_NULL' was not declared in this scope
plugins/imagepng/plugin.cpp:151: error: 'png_infopp_NULL' was not declared in this scope
plugins/imagepng/plugin.cpp:159: error: 'png_infopp_NULL' was not declared in this scope
plugins/imagepng/plugin.cpp:167: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/png.h:1096)
plugins/imagepng/plugin.cpp:167: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/png.h:1096)
plugins/imagepng/plugin.cpp:191: error: 'png_set_gray_1_2_4_to_8' was not declared in this scope
plugins/imagepng/plugin.cpp:237: error: 'png_infopp_NULL' was not declared in this scope
scons: *** [build/debug/shobjs/plugins/imagepng/plugin.os] Error 1
scons: building terminated because of errors.

I've got the two libpng installed on my computer however I still continue
to get that error message ...

I had noticed that /usr/lib/libpng.so and /usr/lib64/libpng.so were
linked to /usr/lib/libpng14.so, so I decided to remove the symbolic link and create one from /usr/lib/libpng.so to /usr/lib/libpng12.so.
But that didn't solve my problem.

To build Zeroradiant I've got to use scons, I tried to "configure scons" so that it choose the right libpng but I found nothing (that's why I used the trick above).

Do you know how I could simply solve it ?

Thanks !

PS:

To build Zeroradiant I use theses instructions :
http://www.qeradiant.com/cgi-bin/tra...ki/ZeroRadiant

I'm running a Gentoo GNU/Linux.

naaman 01-01-2011 04:03 AM

In order to get rid of this compile problem I decided to edit plugin.cpp :
I changed png_voidp_NULL to (png_voidp)NULL
and png_infopp_NULL to (png_infopp)NULL.
I also changed this function : png_set_gray_1_2_4_to_8 to this one :
png_set_expand_1_2_4_to_8 and it seems to work :-)

It's very very dirty but it's the only way I found :-/


All times are GMT -5. The time now is 04:43 AM.