Domanda

I'm trying to compile libpng, which requires the libz. I have installed my owner libz.so.1 at my home and set the LD_LIBRARY_PATH.But it does not get any result because the output of ldd shows that it still uses /usr/local/lib/libz.so.1.

And then the output of make shows like "-L/home/zlib -lz". Why?

È stato utile?

Soluzione

Probably you need a symbolic link from /home/mylibs/libz.so to /home/mylibs/libz.so.1.

Note that -lz will search for libz.so, but not libz.so.1, so the linker will keep on searching and will find such a link in /usr/local/lib.

Other than that, you make want to show the NEEDED entries (which record dynamic dependencies) in the header of your executable, with:

$ objdump -x a.out | grep NEEDED

to see if they are recorded with the full path, as libz.so or as libz.so.1.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top