generic way to access C++ libs?

Diez B. Roggisch deetsNOSPAM at web.de
Mon Nov 8 13:38:53 CET 2004


> given the header file of the c++ lib, it should be possible to determine
> that at run-time. 
> Or, one could give the header file to the generic python wrapper module
> and tell the module also, with which compiler the c++ lib was compiled.

For a certain compiler, that might work. But usually, a shipped  c++ library
hasn't its header files attached to it. 

And as I said before: Not everything in c++ allows for direct translation.
Go take a look at sip or swig, and how to write wrappers for them - in
theory, its only copying the header file. In practice, some amount of extra
work has to be done.

And while it might be possible to make the dyn-wrapper know the internals of
certain compilers, keeping track of these is a tedious and errorprone task
- so why not instead let the compilers do that work? And voila, you've got
your average wrapper generator.


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list