🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50711

2.4.5 linker problem: dlsym(etc) undefined

#50711
From: Ross A Macintyre
Date: Fri, 13 Aug 1993 11:15
52 lines
3553 bytes
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?

Thanks in advance for any help I might receive,
Yours, confused,

Ross
Technical Details
Message-ID: <1993Aug13.111510.25751@cee.hw.ac.uk>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!pipex!uknet!festival!hwcs!raz

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,aa53cc631c3b0d5d,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-08-13 04:37:02 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!pipex!uknet!festival!hwcs!raz
From: raz@cee.hw.ac.uk (Ross A Macintyre)
Subject: 2.4.5 linker problem: dlsym(etc) undefined
Message-ID: <1993Aug13.111510.25751@cee.hw.ac.uk>
Sender: news@cee.hw.ac.uk (News Administrator)
Organization: Dept of Computing & Electrical Engineering, Heriot-Watt University, Scotland
Date: Fri, 13 Aug 1993 11:15:10 GMT
Lines: 52