error: jpeglib.h: No such file or directory compiling gd

chris (2008-09-03 21:14:10)
1983 views
0 replies
When compiling gd, you have to specify the location of your jpeg library using the --with-jpeg=DIR directive. This can seem to be really hard, because even if you point directly at the libjpeg.a or libjpeg.so, it just doesn't work.. you will consistently see this error:

error: jpeglib.h: No such file or directory compiling gd

I have tried compiling libjpeg with --prefix=/usr/local explicitly set at configure time, but reflecting that path in the --with-jpeg=DIR just doesn't place nice either.

To fix this, it seems you have to point at a specific target in the libjpeg makefile by configuring with the following before compiling libjpeg:

./configure --prefix=/usr/local && make && make install && make install-lib

including 'make install-lib' will save your day. This places the libjpeg library in a location where everyone else can see it - don't ask me wny you can't just point to it with your --with-jpeg=DIR option (when compiling gd).. I've not dug down to figure why that doesn't work.


christo

comment