Boost logo

Boost :

From: Kevin Marty (kmarty_at_[hidden])
Date: 2001-03-21 19:36:02

--- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
> BOOST_PYTHON_MODULE_INIT is a macro which is specially-designed for
> DLLs/shared objects. Its definition is:
> #define BOOST_PYTHON_MODULE_INIT(name) extern "C" __declspec
> void init##name()
> So it just ends up defining a void function called init<module-name>
(). You
> probably don't want to use it because of the dllexport stuff, but
> similar function definition makes sense. Now you just have to
figure out how
> to get Python to load a statically-linked module by executing your
> initialization function.

I've been working on embedding Python in an application of mine for
the last few days, and I can confirm that Boost works fine. I just
defined my own initModule() function instead of using
BOOST_PYTHON_MODULE_INIT to get around the __declspec(dllexport)
issue, and then called my initModule() right after Py_Initialize()
from my main program. Then, start the script off with "import
modulename" and it just works.

Thanks for the great library,

Boost list run by bdawes at, gregod at, cpdaniel at, john at