[ale] ld can't find my libraries

Jason Day jasonday at worldnet.att.net
Fri Jun 20 15:14:37 EDT 2003


On Fri, Jun 20, 2003 at 12:10:39PM -0400, Michael D. Hirsch wrote:
> [root at sulfur GD-2.07]# gcc  -shared -L/usr/local/lib GD.o  -o 

< Insert obligatory lecture about compiling programs as root >

> blib/arch/auto/GD/GD.so   -L/usr/lib  -lpng12 -L/usr/lib/X11 
> -L/usr/X11R6/lib -L/usr/local/lib -lgd -L/usr/lib -lz -lfreetype -ljpeg 
> -lm -lX11 -lXpm
> /usr/bin/ld: cannot find -lpng12[root at sulfur GD-2.07]# gcc  -shared 
> -L/usr/local/lib GD.o  -o blib/arch/auto/GD/GD.so   -L/usr/lib  -lpng12 
> -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/local/lib -lgd -L/usr/lib -lz 
> -lfreetype -ljpeg -lm -lX11 -lXpm
> /usr/bin/ld: cannot find -lpng12
> collect2: ld returned 1 exit status
> collect2: ld returned 1 exit status
> 
> Needless to say, I have libpng installed.

Do you have libpng-dev installed?  I've seen this error before, where
the link failed because the dev library wasn't installed.  It was my
understanding that gcc was supposed to search for shared libraries
first (.so), link those first if available, and if not search for static
libraries (.a).  This may have changed in gcc 3 however, because the
documentation seems to indicate that it only looks for .a files.

Check that you have all the -dev packages installed, and that there is a
corresponding libfoo.a file in /lib, /usr/lib/, /usr/local/lib,
/usr/X11R6/lib, or /usr/lib/X11 (which is normally a symlink to
/usr/X11R6/lib).

HTH,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list