*BSD News Article 84002


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!uwm.edu!news-peer.gsl.net!news.gsl.net!news.sprintlink.net!news-peer.sprintlink.net!news.sprintlink.net!news-hub.sprintlink.net!news.sprintlink.net!news-chi-8.sprintlink.net!ns1.tstt.net.tt!feisal
From: feisal@tstt.net.tt (Feisal Mohammed)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: FreeBSD and shared library.
Date: 1 Dec 1996 16:40:18 GMT
Organization: University of the West Indies
Lines: 23
Message-ID: <slrn5a3dkd.7h.feisal@lancelot.valsayn.tt>
References: <57rpjd$fh0@portal.gmu.edu>
NNTP-Posting-Host: cuscon54.tstt.net.tt
X-Newsreader: slrn (0.9.0.0 (BETA) UNIX)

In article <57rpjd$fh0@portal.gmu.edu>, elite wrote:
>Hi, I am trying to put together some compiled objects(*.o files) as a
>shared library.  When I try to do like :
>gcc -o libtest.so -shared obj1.o obj2.o obj3.o ... objn.o
>it gives me an error saying:
>ld: No reference to __DYNAMIC
>
>I tried to find a library that has to do with this symbol, but couldn't.
>Does anyone know how to accomplish this?  It worked fine when I did the exact
>same thing under Linux.

Try loking in /usr/share/mk/bsd.lib.mk, where the rules for building
shared libraries are kept.

You will find that the last step involves ld and not gcc. I had the same 
problem until J"oerg told me where to look.

-Feisal

Feisal Mohammed <feisal@tstt.net.tt>   Ph: 1-809-662-2002 x3171
Dept. of Mechanical Engineering, University of the West Indies.