Website hosting service by

 Back to Index

1.11 Writing Extensions in C++

It is possible to write extension modules in C++. Some restrictions apply. If the main program (the Python interpreter) is compiled and linked by the C compiler, global or static objects with constructors cannot be used. This is not a problem if the main program is linked by the C++ compiler. Functions that will be called by the Python interpreter (in particular, module initalization functions) have to be declared using extern "C". It is unnecessary to enclose the Python header files in extern "C" {...} -- they use this form already if the symbol "__cplusplus" is defined (all recent C++ compilers define this symbol).



2002-2004 Web Hosting Service


Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to


Domain registration - Domain registration, register domain or transfer domain name from only $5.95/yr

Cheap domain registration -
Register domain name and
domain transfer from $7.95/year only