Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 1996 08:51:07 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        ejs@bfd.com (Eric J. Schwertfeger)
Cc:        hackers@FreeBSD.org
Subject:   Re: How to make g++ shared libraries?
Message-ID:  <199604172321.IAA10712@genesis.atrad.adelaide.edu.au>
In-Reply-To: <Pine.BSF.3.91.960417081909.10222A-100000@harlie.bfd.com> from "Eric J. Schwertfeger" at Apr 17, 96 08:25:58 am

next in thread | previous in thread | raw e-mail | index | archive | help
Eric J. Schwertfeger stands accused of saying:
> 
> 
> Well, I got no response on questions, so I'll take this to hackers.
> 
> I'm trying to create a shared version of the Cvo (Cray Visual Objects) 
> c++ library, but it isn't working.  I followed the same steps that I do 
> to make regular c shared libraries (gcc with -c and -fpic, then 
> ld -Bshareable to create the libCvo.so.1.0.  This creates a library that 
> I can link against, but when I try to execute the resulting program, I 
> get:

Are you doing this as a port, or for your own personal work?  Shared 
libraries are easy to build under FreeBSD, but the technique isn't
terribly portable.

Basically, you want a makefile that includes :

LIB=<name stub of your library>
SRCS=<list of all the source files in your library>

SHLIB_MAJOR=<major version number>
SHLIB_MINOR=<minor version number>

.include <bsd.lib.mk>

If you want to do this as part of a port, make a makefile like this, and study
the link process that it uses.

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604172321.IAA10712>