Re: [C++-sig] How can I pass derived Python instances to C++?

2011-09-08 Thread James Amundson
On 09/08/2011 12:17 PM, Stefan Seefeld wrote: On 2011-09-08 13:01, James Amundson wrote: I would like to be able to create a Python class derived from a C++ class, then pass a instance of the Python class back to C++. It isn't clear to me if there is an easy way to do this. import foo class Ba

Re: [C++-sig] How can I pass derived Python instances to C++?

2011-09-08 Thread Stefan Seefeld
On 2011-09-08 13:01, James Amundson wrote: > I would like to be able to create a Python class derived from a C++ > class, then pass a instance of the Python class back to C++. It isn't > clear to me if there is an easy way to do this. > > > import foo > class Bar(foo.Foo): > def __init__(self)

[C++-sig] How can I pass derived Python instances to C++?

2011-09-08 Thread James Amundson
I would like to be able to create a Python class derived from a C++ class, then pass a instance of the Python class back to C++. It isn't clear to me if there is an easy way to do this. Here is a simple example of what I wish worked, but doesn't: C++ side: #include #include class Foo { publ

Re: [C++-sig] Build Errors Making the "quickstart" Demo Project

2011-09-08 Thread Niall Douglas
If you're building stock using bjam, and it's failing, it's a bug :) See if there's anything similar at https://svn.boost.org/trac/boost/search?q=python&noquickjump=1&ticket= on and if not, report it. Sorry can't help much more personally. I haven't used BPL, or Boost for that matter, in over f

Re: [C++-sig] Dynamic Cast failed over multiple modules

2011-09-08 Thread Holger Brandsmeier
Mathieu, thank you very much. This is exactly what I was still missing. -Holger On Thu, Sep 8, 2011 at 12:00, Mathieu Malaterre wrote: > On Thu, Sep 8, 2011 at 11:56 AM, Holger Brandsmeier > wrote: > [...] >> CMAKE_SHARED_LINKER_FLAGS. About the RTLD_GLOBAL flag for dlopen, I >> don't know ho

Re: [C++-sig] Dynamic Cast failed over multiple modules

2011-09-08 Thread Mathieu Malaterre
On Thu, Sep 8, 2011 at 11:56 AM, Holger Brandsmeier wrote: [...] > CMAKE_SHARED_LINKER_FLAGS. About the RTLD_GLOBAL flag for dlopen, I > don't know how python handles this. > > Do you have any ideas how to solve this? Or is this simply not > possible with python? Here is what I use: if os.name =

[C++-sig] Dynamic Cast failed over multiple modules

2011-09-08 Thread Holger Brandsmeier
Dear List, when I use dynamic cast from two boost modules on a class with "vague linkage", in my real use case a template in the simplified example I show you a class which is declared inline, then the dynamic cast fails in the second module. So when I call the code from python from the first mod