Duncan Grisby writes:
On Monday 15 November, Geoffrey Furnish wrote:
[...]
2) No global objects as we are linking against a C compiled Python.
There is a patch posted on the C++ SIG website, which modifies the configure script for Python to allow you to get your main linked with C++, which ensoures that global ctors get run correctly. If you use that, you don't need rule 2) above.
I'm intrigued by the assertion that you can't use global objects when the Python executable is compiled with C. For which platforms is it true? I've successfully used global C++ objects with constructors on Linux, Solaris and Windows NT, without compiling Python itself with C++.
1. ((off topic) If you eat lunch with anyone who's responsible for http://www.uk.research.att.com/vnc, pass on my thanks for a great piece of software) 2. I've been assuming that all implementations that use ELF-based shared libraries initialize global objects correctly. This was mentioned in an article in Computing in Science and Engineering: @Article{Gray99Shadow, author = {M. C. Gray and R. M. Roberts and T. M. Evans}, title = {Shadow-object interface between Fortran95 and C++}, journal = {Comp. in Sci. and Engineer.}, year = 1999, volume = 1, number = 2, pages = {63-70}, annote = {http://computer.org} } They support their statment with a footnote to the Linker and Libraries Guide, Solaris 2.6 Software Developer Collection vol 1., http:://docs.sun.com. Phil