From owner-freebsd-hackers Wed Apr 17 11:29:18 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id LAA25294 for hackers-outgoing; Wed, 17 Apr 1996 11:29:18 -0700 (PDT) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id LAA25289 for ; Wed, 17 Apr 1996 11:29:14 -0700 (PDT) Received: (from jdp@localhost) by austin.polstra.com (8.7.5/8.6.12) id LAA17682; Wed, 17 Apr 1996 11:28:50 -0700 (PDT) Date: Wed, 17 Apr 1996 11:28:50 -0700 (PDT) From: John Polstra Message-Id: <199604171828.LAA17682@austin.polstra.com> To: ejs@bfd.com Subject: Re: How to make g++ shared libraries? Newsgroups: polstra.freebsd.hackers In-Reply-To: Organization: Polstra & Co., Seattle, WA Cc: freebsd-hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In article ejs@bfd.com writes: > > 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: > > Cvo-24: Global constructors were probably not called. You must include "/usr/lib/c++rt0.o" near the front of your "ld" command line when creating C++ shared libraries. E.g., ld -Bshareable -o libfoo.so.1.0 /usr/lib/c++rt0.o *.o If you are using the standard FreeBSD makefiles (), you can accomplish this by defining the CPLUSPLUSLIB make variable. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth