*BSD News Article 65607


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!qns3.qns.com!imci4!newsfeed.internetmci.com!csn!news-1.csn.net!csn!nntp-xfer-2.csn.net!news.boulder.noaa.gov!news
From: Sean Kelly <kelly@fsl.noaa.gov>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: FreeBSD vs Linux
Date: Wed, 10 Apr 1996 16:27:25 -0600
Organization: NOAA Forecast Systems Laboratory
Lines: 30
Message-ID: <316C35CD.25AC@fsl.noaa.gov>
References: <4issad$h1o@nadine.teleport.com> <31657509.5E45C160@gnu.ai.mit.edu> <4k4cfa$ava@uriah.heep.sax.de> <3169406A.61F8D18D@gnu.ai.mit.edu> <4kcsjc$ii@dyson.iquest.net> <316AA938.74276335@gnu.ai.mit.edu>
NNTP-Posting-Host: emu.fsl.noaa.gov
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (X11; I; HP-UX B.10.01 9000/715)

H.J. Lu wrote:
> Correct me if I am wrong. There are no simple ways to create
> a shared C++ library under FreeBSD.

Okay, you're wrong.  :-)

> With ELF, you build a shared C++ library, just like a
> shared C library.

With FreeBSD's a.out format, I'm building shared C++ libraries the same
way I build shared C libraries:

Makefile:
---
CPLUSPLUSLIB = yes
LIB          = foundation
SRCS         = Thing.cc Dict_hash.cc Dict.cc Seq.cc
.include <bsd.lib.mk>
---

And these even contain file-scope and static objects.  They get
constructed
and destroyed just fine.  I'm even doing some of my template
instantiations
in shared libraries!  Zowie!  ;-)

-- 
Sean Kelly                          
NOAA Forecast Systems Laboratory    kelly@fsl.noaa.gov
Boulder Colorado USA                http://www-sdd.fsl.noaa.gov/~kelly/