Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

building GD/gcc linking..



Grant M. wrote:
> Ok, I was trying to build GD and it kept telling me libjpeg wasn't
> installed, so after some tracking, it comes down to this:
> ld says it can't find the library:
>    gcc ./test.c -o test -L/usr/lib -l jpeg
>    /usr/bin/ld: cannot find -ljpeg
> 
> I tried several variations of this:
>    gcc ./test.c -o test -L/usr/lib -l libjpeg
>    gcc ./test.c -o test -L/usr/lib -l libjpeg.so.62
>    gcc ./test.c -o test -L/usr/lib -l /usr/local/libjpeg.so.62
> 
> all with the same result.
> I then did this:
>    /sbin/ldconfig -v | grep -i jpeg
>         libimlib-jpeg.so -> libimlib-jpeg.so
>         libjpeg.so.62 -> libjpeg.so.62.0.0
> 
> Which I believe indicates that it should have found it.
> 
> Any suggestions?

The problem is with library versioning.  You have a version of the jpeg
library installed, but there is a convention with the linker that there
should exist (for initial linking purposes) a .so version (with no
numbers).  Redhat has taken the stance that since this symbolic link is
only needed for compilation, then it is part of the -devel package.  So,
the right solution to your problem is to install the -devel package
corresponding to the package containing the libjpeg library.  The
naughty thing you could do is just manually 'ln -s libjpeg.so.62 libjpeg.so'

Hope that helps.
--Matt




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org