C++ extension modules on NT

Duncan Grisby dgrisby at uk.research.att.com
Fri Nov 5 15:41:12 CET 1999


I am working on a binding from omniORB, a free CORBA ORB, to Python,
and I have run into a problem with Windows NT. The omniORB library is
written in C++ and, unfortunately for me, involves some global objects
with constructors. On Linux and Solaris, and presumably other Unixes,
these constructors are called correctly when Python loads my extension
module.

On NT, however, the constructors are never called, and the global
objects contain garbage. The document "Extending and Embedding the
Python Interpreter" mentions this problem in section 1.11, and says
that the problem doesn't occur if the Python interpreter's main()
function is compiled with C++. Unfortunately, this appears to be
incorrect, and the constructors still aren't called.

Does anyone have any experience with this sort of thing?  Is there
some way I can link a DLL so that it runs constructors when it is
loaded?  I've looked around on python.org, but I can't find anything.


By the way, if you want to try a pre-release of omniORBpy (but not on
NT...), see

  http://www.uk.research.att.com/omniORB/archives/1999-11/0027.html

for details.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --




More information about the Python-list mailing list