views:

159

answers:

2

How is Python able to call C++ objects when the interpreter is C and has been built w/ a C compiler?

+2  A: 

C++ can interoperate with C by extern "C" declarations.

zvrba
+6  A: 

Boost.Python has special macros that declare functions with extern "C" so the Python interpreter will be able to call them. It's kind of complicated, but you can look at the Boost documentation for more info.

Kristo