Article View: comp.std.c++
Article #3483Re: standardizing routines without main()
From: Christopher Barber
Date: Thu, 15 Feb 1996 21:32
Date: Thu, 15 Feb 1996 21:32
24 lines
1768 bytes
1768 bytes
>>>>> "SV" == Stephen Vavasis <vavasis@CS.Cornell.EDU> writes:
SV> I would like to write a subroutine in C++ that gets called
SV> by an existing program. The subroutine might get loaded with a
SV> dynamic loader into an already compiled program to which I, the C++
SV> programmer, have no access.
SV> In this case, there is no C++ main(). Nonetheless, I would still
SV> like to use C++ features like global static data items whose
SV> constructors and destructors get called.
You can still use global static data. The constructors will be called
the first time the shared object is loaded. Of course, you need to have
a compiler that will support building shared objects.
- Chris
--
Christopher Barber ----- Software Engineer ---- BBN Systems and Technologies
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is
in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID:
<CBARBER.96Feb15151343@figaro.bbn.com>Path:
arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austernReferences:
<4fvmd1$bh1@syn.cs.cornell.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern From: cbarber@bbn.com (Christopher Barber) Newsgroups: comp.std.c++ Subject: Re: standardizing routines without main() Date: 15 Feb 1996 13:32:15 PST Organization: BBN Approved: austern@isolde.mti.sgi.com Message-ID: <CBARBER.96Feb15151343@figaro.bbn.com> References: <4fvmd1$bh1@syn.cs.cornell.edu> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 15 Feb 1996 20:13:43 GMT In-Reply-To: vavasis@CS.Cornell.EDU's message of 15 Feb 1996 09:20:36 PST X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMSOmdEy4NqrwXLNJAQFHSAH/dRjbQlSEkxWzcBai2cqF9oT1NmqNJM21 AMucZEoJ/FPkIJ2e+voKaQQa3xdwpPv4zZrmyqVNEVddQWa9xm+P9g== =Lpai Originator: austern@isolde.mti.sgi.com