[C++-sig] sharing code between different python extensions

Wintersberger, Eugen eugen.wintersberger at desy.de
Thu Oct 23 15:47:55 CEST 2014


Hi

On Thu, 2014-10-23 at 08:11 -0400, Nat Goodspeed wrote:
> On Oct 22, 2014, at 8:08 AM, "Wintersberger, Eugen" <eugen.wintersberger at desy.de> wrote:
> 
> >  I have a little problem with two Python extensions (C++ with
> > boost::python) where share code. 
> > 
> > I have to Python extensions ('a' and 'b') each of them exporting two
> > functions. What I want is to use a function exported by 'a' in the code
> > of 'b'. Though the package compiles I get an unresolved symbol error
> > when trying to load 'b'. 
> 
> If I were faced with this situation either in pure Python, or pure C++, I would probably break out module 'c' with functions consumed by both 'a' and 'b'.
> Could this work in your situation?

This approach would not really help me. I guess what I really need is
something like the numpy approach: a way to export the API of an
extension to other extensions. But I have no idea how to do this ;)?

Are there any reference you can suggest which I should read if I want to
follow this approach?

regards
  Eugen

> > 
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> https://mail.python.org/mailman/listinfo/cplusplus-sig

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20141023/aa1f15cf/attachment-0001.sig>


More information about the Cplusplus-sig mailing list