configure: error: libjpeg.(a|so) not found.

chris (2008-07-22 22:46:15)
5196 views
2 replies
Compiling GD or ImageMagik support into PHP, you will need to point the ./configure script at the locations of your shared libjpeg and libpng libraries. Normally you would do this by adding '--with-jpeg-dir=../usr/lib/ --with-gd' at configure time, having first installed those shared objects (in this case into /usr/lib).

However, this has started breaking recently since the libjpeg and libpng installers don't always create a file called libjpeg.so. A lot of users are getting thrown by this. The outcome is a configure error like this:

checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... yes
checking for the location of libjpeg... ../usr/lib/
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: libjpeg.(a|so) not found.
chris@brezhnev:/usr/src/php-5.2.6$

Running a 'locate libjpeg|grep so' on your system will probably reveal the following two files:

chris@brezhnev:/usr/src/php-5.2.6$ locate libjpeg| grep so
/usr/lib/libjpeg.so.62
/usr/lib/libjpeg.so.62.0.0

So it's no wonder that you can't find libjpeg.so. It doesn't exist.

Mucky, thought it sounds, the solution to this problem is to simply copy the file over with it's expected name. You could also achieve the same with a symbolic link. Either way, your ./configure script will continue through to the end.

christo
comment
palli
2008-07-24 12:18:08

More problems

Thanks for this, but it did not solve my problem.
I'm using Suse 10.2 64 bit and the location of th libis is /usr/lib64
I tried following config:
--with-jpeg-dir=/usr/lib64
Then I copied the files libjpeg.so and libpng.so from /usr/lib64 to /usr/lib and used this configuration:
--with-jpeg-dir=/usr/lib
And it works!!

Bug in configure??
I hope this can help someone else.

Palli

reply icon
Franz Holzinger
2008-11-15 18:09:32

--with-libdir=lib64

Thanks for this, but it did not solve my problem.
I'm using Suse 10.2 64 bit and the location of th libis is /usr/lib64
I tried following config:
--with-jpeg-dir=/usr/lib64
Then I copied the files libjpeg.so and libpng.so from /usr/lib64 to /usr/lib and used this configuration:
--with-jpeg-dir=/usr/lib
And it works!!

Bug in configure??
I hope this can help someone else.

Palli

This is for SUSE 10.x x86_64:

./configure --enable-so --with-mysql --with-gd --with-xsl --with-curl -with-png-dir --with-zlib-dir --with-libdir=lib64 ...


You must add the parameter --with-libdir=lib64 to tell it to use lib64 instead of lib.
reply iconedit reply