Article View: gnu.gcc.help
Article #50715Re: 2.4.5 linker problem: dlsym(etc) undefined
From: Michael Salmon
Date: Fri, 13 Aug 1993 14:27
Date: Fri, 13 Aug 1993 14:27
65 lines
4238 bytes
4238 bytes
In article <1993Aug13.111510.25751@cee.hw.ac.uk>, raz@cee.hw.ac.uk (Ross A Macintyre) writes: |> I have just installed gcc-2.4.5 and am getting these kind of errors reported: |> |> mbstowcs.o(.text+108): undefined reference to `dlsym' |> wcstombs.o(.text+104): undefined reference to `dlsym' |> mblib.o(.text+24): undefined reference to `dlclose' |> mblib.o(.text+98): undefined reference to `dlopen' |> collect: ld returned 1 exit status |> make: *** [control] Error 1 |> |> The command that produced this was: |> (this is from a Makefile produced by Xdesigner) |> |> gcc -g -o control main.o widget.o s.o z.o s_z.o s_time.o z_time.o s_freq.o z_freq.o xd_links.o polymath.o g3d.o -O -pipe -L/depot/X11R5/lib -lMrm -lXm -lUil -lXmu -lXt -lXext -lX11 -lm |> |> The problem is obviously with the linker. |> I can link it fine if I use /usr/bin/ld or cc. |> |> On further investigation, the only place I can find these object files are in |> /usr/lib/libc.a. And as you probably know, dlsym, dlclose and dlopen are |> shared object code, and are in the library /usr/lib/libdl.so.1.0.(the manual |> page told me to use -ldl, and there is no /usr/lib/libdl.a). |> If I stick in "-ldl" I get the error: |> /depot/gnu/sparc-sun-sunos4.1/bin/gld: Can't open dl |> I tried linking with gld (from binutils-2.2.1) but this was even worse. |> |> More info by saying "gcc -v" gives: |> gcc -g -v -o control main.o widget.o s.o z.o s_z.o s_time.o z_time.o s_freq.o z_freq.o xd_links.o polymath.o g3d.o -O -pipe -L/depot/X11R5/lib -lMrm -lXm -lUil -lXmu -lXt -lXext -lX11 -lm |> Reading specs from /depot/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5/specs |> gcc version 2.4.5 |> /depot/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5/ld -e start -dc -dp -o control /lib/crt0.o -L/depot/X11R5/lib -L/depot/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5 -L/depot/gnu/lib main.o widget.o s.o z.o s_z.o s_time.o z_time.o s_freq.o z_freq.o xd_links.o |> polymath.o g3d.o -lMrm -lXm -lUil -lXmu -lXt -lXext -lX11 -lm -lgcc -lc -lg -lgcc |> mbstowcs.o(.text+108): undefined reference to `dlsym' |> wcstombs.o(.text+104): undefined reference to `dlsym' |> mblib.o(.text+24): undefined reference to `dlclose' |> mblib.o(.text+98): undefined reference to `dlopen' |> collect: ld returned 1 exit status |> |> I had thought that the installation of gcc-2.4.5 had gone ok as there were no |> errors and it did the make tests ok. I've installed on sparc-sunos4.1.1 |> and also on mips-ultrix4.2. I didn't install glibc as I was told that this was |> unneccessary and I'd had BIG problems last time I'd tried this. Though I |> installed libg++ for c++ and this seems ok. |> Has anybody experienced this behaviour before and can anybody give me |> some clues as to what to do. |> I'd also appreciate some pointers in how one can use the "specs" file; maybe |> I should edit this to tell it to use another linker. For example if one |> installs the binutils, how do you tell gcc to use the new version of gld? Is it |> safe to do this? I think that the problem is that gcc is using gld instead of ld, try making a symbolic link from /depot/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5/gld to /bin/ld so that gcc will use it first. Alternatively carefully remove all gld's from your system (not just those in your path). -- Michael Salmon #include <standard.disclaimer> #include <witty.saying> #include <fancy.pseudo.graphics> Ericsson Telecom AB Stockholm
Technical Details
Message-ID:
<1993Aug13.142745.15040@ericsson.se>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!pipex!sunic!ericom!eos.ericsson.se!etxmesaReferences:
<1993Aug13.111510.25751@cee.hw.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,aa53cc631c3b0d5d X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-08-13 07:47:59 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!pipex!sunic!ericom!eos.ericsson.se!etxmesa From: etxmesa@eos.ericsson.se (Michael Salmon) Subject: Re: 2.4.5 linker problem: dlsym(etc) undefined Message-ID: <1993Aug13.142745.15040@ericsson.se> Sender: etxmesa@eos6c02 (Michael Salmon) Nntp-Posting-Host: eos6c02.ericsson.se Reply-To: etxmesa@eos.ericsson.se (Michael Salmon) Organization: Ericsson Telecom AB References: <1993Aug13.111510.25751@cee.hw.ac.uk> Date: Fri, 13 Aug 1993 14:27:45 GMT Lines: 65