Date: Thu, 11 Mar 1999 10:22:17 +0200 From: Graham Wheeler <gram@cdsec.com> To: Niall Smart <nsmart@kira.team400.ie>, hackers@freebsd.org Subject: Re: C++ global constructors and shared libraries Message-ID: <36E77D39.7A2F779D@cdsec.com> References: <36E6AB40.742D64BB@cdsec.com> <36E6BFE4.951172E3@kira.team400.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
Niall Smart wrote: > > Graham Wheeler wrote: > > > > Hi folks > > > > I have just changed some C++ code libraries from static to shared. > > I now find that some global objects declared in these libraries > > are no longer having their constructors called. If I move the object > > niall% g++ -v > cc -v > gcc version 2.7.2.1 This is the same version I am using. > niall% g++ -c -fpic libfoo.cc > niall% g++ -shared libfoo.o -o libfoo.so I am using the bsd.lib.mk and related include files for the Make; certainly I don't think that there is anything strange in these. > niall% g++ main.cc -Wl,-R,. -L. -lfoo I don't have the -Wl,-R,. options; would these make any difference at all? -- Dr Graham Wheeler E-mail: gram@cdsec.com Citadel Data Security Phone: +27(21)423-6065/6/7 Firewalls/Virtual Private Networks Fax: +27(21)24-3656 Internet/Intranet Network Specialists Data Security Products WWW: http://www.cdsec.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36E77D39.7A2F779D>