Article View: comp.std.c++
Article #1344Re: Calling c++ from a c program
From: Ken Raeburn
Date: Thu, 27 Jun 1991 01:14
Date: Thu, 27 Jun 1991 01:14
19 lines
1140 bytes
1140 bytes
In article <3575@laura.UUCP> rs@heike.informatik.uni-dortmund.de (Roland Schwan) writes:
...c-file:
main()
{....
..
something();
....
}
The problem here is that some C++ implementations (UNIX ones at least
-- I haven't used others, and you didn't say what you were using)
require that `main' be compiled as C++ code, in order for constructors
for static objects to be run.
If you can't move this `main' routine into a C++ file, rename it to
`main2' or something, and add a new `main' routine in a C++ file which
simply calls `main2'.
Technical Details
Message-ID:
<RAEBURN.91Jun26211431@steve-dallas.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!raeburnReferences:
<3575@laura.UUCP>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!raeburn From: raeburn@athena.mit.edu (Ken Raeburn) Subject: Re: Calling c++ from a c program In-Reply-To: rs@heike.informatik.uni-dortmund.de's message of 26 Jun 91 14:18:39 GMT Message-ID: <RAEBURN.91Jun26211431@steve-dallas.mit.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology References: <3575@laura.UUCP> Date: Thu, 27 Jun 91 01:14:36 GMT Lines: 19