For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2004 > error due to -ldl option









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author error due to -ldl option
Richard Baxter

2004-03-27, 12:17 am

Dear All,

I am trying to install a program from source on a system running
Mandrake Linux 9.x with gcc-g77-3.2. I edited the include file to
change 'f77' to 'g77'. During the build I get the following error:

make[1]: Entering directory `/opt/pkgs/mosflm623/mosflm'
g77 -s -static control.o mosflm_all_ip_inc.o unoptimizable.o pck.o
chelp.o open_socket.o close_socket.o read_socket.o write_socket.o
write_stuff_to_socket.o status_messages.o mosflm_jpeg.o image_toys.o
matzerr.o hklmanage.o /opt/pkgs/mosflm623/lib/DPSLIB.a
.../cbf/lib/libcbf.a ../jpg/libjpeg.a \
-L/opt/pkgs/ccp4-4.2.1/lib -lccp4 -lxdl_view -lncurses
-L/usr/X11R6/lib -lXt -lSM -lICE -lX11 -ldl -lpthread -lstdc++ -lg2c
-lm -o ../bin/ipmosflm
/usr/bin/ld: cannot find -ldl
collect2: ld returned 1 exit status
make[1]: *** [ipmosflm] Error 1

My limited prgramming knowledge suggests this is a linking error,
possibly a syntax problem? I would like some advice on how to go about
findin/fixing it. Any help greatly appreciated
Dr Ivan D. Reid

2004-03-27, 12:17 am

On 23 Mar 2004 11:00:17 -0800, Richard Baxter <rbaxter@uchicago.edu>
wrote in <1f3046c3.0403231100.72a8d4f8@posting.google.com>:

> make[1]: Entering directory `/opt/pkgs/mosflm623/mosflm'
> g77 -s -static control.o mosflm_all_ip_inc.o unoptimizable.o pck.o
> chelp.o open_socket.o close_socket.o read_socket.o write_socket.o
> write_stuff_to_socket.o status_messages.o mosflm_jpeg.o image_toys.o
> matzerr.o hklmanage.o /opt/pkgs/mosflm623/lib/DPSLIB.a
> ../cbf/lib/libcbf.a ../jpg/libjpeg.a \
> -L/opt/pkgs/ccp4-4.2.1/lib -lccp4 -lxdl_view -lncurses
> -L/usr/X11R6/lib -lXt -lSM -lICE -lX11 -ldl -lpthread -lstdc++ -lg2c
> -lm -o ../bin/ipmosflm
> /usr/bin/ld: cannot find -ldl
> collect2: ld returned 1 exit status
> make[1]: *** [ipmosflm] Error 1


> My limited prgramming knowledge suggests this is a linking error,
> possibly a syntax problem? I would like some advice on how to go about
> findin/fixing it. Any help greatly appreciated


My limited UNIX knowledge suggests that you need to find where
on your system the library libdl.a resides (hint: man find), and include
the path to it with a -L switch. If you don't have such a file, find out
how to get it and install it in one of the usual places, perhaps /usr/lib.

Alternatively, remove it from your makefile to see if it's really
needed (will lead to errors due to missing references).

--
Ivan Reid, Electronic & Computer Engineering, ___ CMS Collaboration,
Brunel University. Ivan.Reid@brunel.ac.uk Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
Pierre Asselin

2004-03-27, 12:18 am

Richard Baxter <rbaxter@uchicago.edu> wrote:
> /usr/bin/ld: cannot find -ldl


On my RH box, /usr/lib/libdl.so is part of the glibc-devel package.

$ rpm -qi glibc-devel
[ snip ]
Description :
The glibc-devel package contains the header and object files necessary
for developing programs which use the standard C libraries (which are
used by nearly all programs). If you are developing programs which
will use the standard C libraries, your system needs to have these
standard header and object files available in order to create the
executables.

Install glibc-devel if you are going to develop programs which will
use the standard C libraries.

--
pa at panix dot com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com