[C++-sig] Boost Python v2 - extending and embedding - memory leaks, compiler warnings

Nicolas Lelong n_lelong at hotmail.com
Tue Nov 12 16:41:17 CET 2002


> >> No, there aren't. People have done it, with BPLv2 though. I would love
> >> to have an example that I could put in the distribution...
>
> I'd still love to have a small embedding example...
>

OK, I crafted a small example from my test files ; it's quite dumb - and may
not be perfect - so I'm open to every comment ...

> > The simple thing you can do is to remove the __declspec(dllexport)
there,
> > and you're done. Ideally, someone should make a patch to account for
that
> > via 'boost/python/detail/config.hpp' as I've done it [but I don't known
how
> > to submit a patch - any pointers (no time to search myself...) ].
>
> Just `diff -wu' your copy of the file with the copy in the source
> distro, and post the output /as an attachment/.
>

Here it is, I hope I ordered well the files on the command line...

All that is to be done is define BOOST_PYTHON_EXTEND_EMBEDDED in
boost/detail/config.hpp - or perhaps just defining before the boost.python
includes in the embedding application should do (if boost.python does not
define modules).

Nicolas.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: extend_embedded_patch.txt
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20021112/c66efaa1/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: extend_embedded_example.cpp
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20021112/c66efaa1/attachment-0001.txt>


More information about the Cplusplus-sig mailing list