[C++-sig] Boost Python-C++ library Integration

Nat Goodspeed nat at lindenlab.com
Fri Jan 18 22:48:25 CET 2008


senthil arasu wrote:

> Any body can suggest me the integration procedure of c++ static 
> library(.lib) in boost python.
> I have succesfuly installed boost python & tested helloworld  example.
>  
> In tutorials i could not find details specific to my requirement.

   I'm not sure what you mean by integrating a static library into 
Python. The simplest meaning would be that you'd like to rebuild the 
Python interpreter, statically linking your library with it. But I don't 
think that's what you really want.
   If the primary use for this library is as a Python extension, then 
you're better off changing it to a dynamic library so the Python import 
statement can dynamically load it.
   If the primary use for this library is to be statically linked with 
other (e.g.) C++ programs, but you also want to be able to use it as a 
Python module, then maybe you should introduce a new dynamic library 
that statically links with your original library and contains the 
Boost.Python definitions to publish its symbols to Python.
   Does that make sense?



More information about the Cplusplus-sig mailing list