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

Nicolas Lelong n_lelong at hotmail.com
Tue Nov 12 14:18:56 CET 2002

> >> > When it links it says "Creating library ....lib and object
> >> ....exp",
> >>        ^^
> >> What is "it"?
> >
> > Sorry, that's VC7's linker.  In light of the build information I can
> > get from bjam, are there any simple examples of an app that extends and
> > embeds, instead of building to a .pyd?  Then I might be able to clean
> > up my build configuration.
> 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...

The linker wants to create the ".lib" and ".exp" files because your EXE
exports some symbols (the way a DLL would do it). I had this 'problem'
recently and fixed it.

The symbols exported from the EXE are the init functions for the modules you
create (the code can be found in boost/python/module_init.hpp) that are
declared with the keyword __declspec(dllexport).

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...) ].

Hope that helps,

More information about the Cplusplus-sig mailing list