[C++-SIG] Python calling C++ issues

skaller skaller at maxtal.com.au
Thu Dec 2 15:51:39 CET 1999


David Beazley wrote:

> Aiiiigh!!! Make it stop! Make it stop!

	Try ocaml :-)
 
> However, with that said, I'm still a big fan of keeping things as
> simple as is reasonable.
> 
> As for the extern "C" issue, I would love to know how to officially
> resolve that issue.

	First you read the Standard. If you can't work out what it means,
you ask a committee delegate (such as me). If I can't figure it
out, which is likely, I can post the question directly on the committee
email reflector, and echo the responses back to you.

>  For now, I've solved it by simply slapping an
> extern "C" around everything that gets hooked to Python (all wrapper
> functions).  Still, it doesn't seem like a very satisfactory solution.
> I have no idea what it implies for something like CXX.

	You must assume your client (possibly you) has a 
C/C++ compiler pair, and Python was built with the C part of it
(except for main, which must be built with C++ to ensure the
run time is set up for exception handling and RTTI).

	When it comes to DLLS/shared libraries, you must
rely on vendor specs, and luck. The same applies to
threading, and calling ANY system function other than
those required by the Standard.

	That is, basically, Guido's "get real" approach
is pretty close to the right idea. :-)

-- 
John Skaller, mailto:skaller at maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850




More information about the Cplusplus-sig mailing list