LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   libpng hell (https://www.linuxquestions.org/questions/linux-software-2/libpng-hell-296289/)

voyciz 03-01-2005 09:51 AM

libpng hell
 
OK, I actually had this problem solved once, but it was long ago, and I can't remember what I did. Stupid me, I forgot to back up all the packages I had created when I reformatted, so I'm attempting to recreate them all now.

Makefile configuration with mplayer failed, telling me that I needed libpng and libpng-dev installed. I have the package that comes with Slack 10, libpng-1.2.5-i486-2 installed. I visited the libpng page on sourceforge, went to the dev section, and found nothing but betas and release candidates, so I was certainly in the wrong place. linuxpackages.net has libpng packages, but no libpng-dev ones. I found a libpng-dev RPM, so I got that, used rpm2tgz to convert it, took a look at the files, and realized I already had those installed! I have png.h and pngconf.h in both /usr/include/libpng and /usr/include/libpng12...do I need any other header files than this? I looked at the output of "./configure --help" in the MPlayer source directory, but there was no option to specify the location of libpng. Someone please help me, I keep running into this problem and I'm so tired of it.

jtshaw 03-01-2005 10:18 AM

Do you have the libpng12-config and the libpng-config programs? That is most likely how it is checking to see if you have the library installed.

voyciz 03-01-2005 10:38 AM

Yeah, I have those, and when I use both "libpng-config --prefix" and "libpng12-config --prefix", it prints "/usr", which is correct.

__J 03-01-2005 03:19 PM

open up the config.log in the mplayer source. some versions of libpng are touchy on thier functions ( most configure scripts check for libpng by compiling a small program with a particular function).

voyciz 03-01-2005 05:25 PM

Code:

============ Checking for PNG support ============

#include <png.h>
#include <string.h>
int main(void) {
  printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
  printf("libpng: %s\n", png_libpng_ver);
  return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
}

cc    /tmp/mplayer-conf-9723-8006.c -o /tmp/mplayer-conf-9382-8006.o -lpng -lz
-lm

ldd /tmp/mplayer-conf-9382-8006.o
        not a dynamic executable

Result is: no (mismatch of library and header versions)

Mismatch, eh? That's strange, I only have one libpng package installed... Well I'll build my own and see how that works out. Thanks, __J.

voyciz 03-01-2005 06:32 PM

Eh, screw that, didn't feel like making a package. I read the libpng header files and they are both version 1.2.5, and that's how it should be. I removed that package, though, and tried out a version 1.2.8 libpng package from linuxpackages.net and ran the configure script again...same result :(. I'm lost...

__J 03-02-2005 05:32 AM

Code:

#include <png.h>
#include <string.h>
int main(void) {
  printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
  printf("libpng: %s\n", png_libpng_ver);
  return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
}

toss that code into a text editor, compile it, and see what the output is on your system. do you use any 3rd party package management on your system? I've compiled MPlayer a few times on my slack 10 box and never had any problems.

voyciz 03-02-2005 09:23 AM

I used "gcc -o test test.c", where test.c contains your code...is that right? When I tried it, I got this error:

Code:

/tmp/ccGWjU6Z.o(.text+0x29): In function `main':
: undefined reference to `png_libpng_ver'
/tmp/ccGWjU6Z.o(.text+0x3e): In function `main':
: undefined reference to `png_libpng_ver'
collect2: ld returned 1 exit status

I was just thinking, I just built imlib2 with png support and it was fine...isn't that kinda weird?

voyciz 03-02-2005 10:49 AM

Well, what a nice little workaround: I just passed "--enable-png" to the configure script and everything went great...maybe something is wrong with its test program, I've never used 1.0pre6a before... Thank you both, jtshaw and __J, I appreciate it.


All times are GMT -5. The time now is 03:50 PM.