I'm trying to compile the example from the Boost Python docs without
success.
hello.cpp:
#include
char const * const greet() {
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext) {
using namespace boost::python;
def("greet", greet);
}
I have Boost 1.48, Python 2.7, a
Hi,
I'm new to python.boost library and I'm trying to use it to wrap a third
party library. Everything else I've managed to get working - thanks to
excellent library and lot of examples I've found around a net.
Only thing I can't get working properly is instance ownership transfer
in constru
Hi Joel,
On 5 July 2012 12:21, Joel Uckelman wrote:
> I'm trying to compile the example from the Boost Python docs without
> success. [...]
>
There are many ways in which you can fix this. I think the easiest one from
an I'm-just-starting-so-please-give-me-a-simple-hello-world-program point
of
Thus spake Sybren A. Stüvel:
>
> Hi Joel,
>
> On 5 July 2012 12:21, Joel Uckelman wrote:
>
> > I'm trying to compile the example from the Boost Python docs without
> > success. [...]
> >
>
> There are many ways in which you can fix this. I think the easiest one from
> an I'm-just-starting-so-
On 5 July 2012 13:10, Joel Uckelman wrote:
> Do you know why Boost Python complains about returning a char const*?
>
When returning a pointer, you have to tell Boost::Python what to do with
it. The most important issue is one of ownership. Once the pointer has been
returned as a Python object in
It looks like you inserted an extra const (I don't see it in the current
tutorial) ...
char const * const greet() {
It should work if you remove it.
Ralf
On Thu, Jul 5, 2012 at 3:21 AM, Joel Uckelman wrote:
> I'm trying to compile the example from the Boost Python docs without
> success.
>
>
Oops, I meant to mark the extra const with a color:
char const * *const* greet() {
On Thu, Jul 5, 2012 at 7:57 AM, Ralf Grosse-Kunstleve wrote:
> It looks like you inserted an extra const (I don't see it in the current
> tutorial) ...
>
> char const * const greet() {
>
> It should work if you r
Thus spake Ralf Grosse-Kunstleve:
>
> It looks like you inserted an extra const (I don't see it in the current
> tutorial) ...
>
> char const * const greet() {
>
> It should work if you remove it.
Ha! You're correct. The example program was so short that I just retyped
it, and I made the pointe
On 05/07/12 11:49, Jani Tiainen wrote:
> Hi,
>
> I'm new to python.boost library and I'm trying to use it to wrap a third
> party library. Everything else I've managed to get working - thanks to
> excellent library and lot of examples I've found around a net.
>
> Only thing I can't get working pr
I want to do it another way around:
Instance of Owner should hold reference to data_1 and data_2 as long as
owner is alive.
Now following happens:
owner = Owner()
data_1 = Data(owner) # data_1 ownership is transferred to owner object
data_2 = Data(owner) # data_2 ownership is transferred to owner
Jani,
ok what you want to do is quite a lot more intrusive, so you need some
more involved methods, but it should be possible. I would do it by
noting the following
- data_1 is published to python as a boost::shared_ptr (default
holder type)
- usually it is difficult for a class member function,
Hi,
I'm still strugling with this whole thingy so I came up with more
concrete example I'm trying to achieve:
http://pastebin.com/dVRfT56x
And in python code I do like this:
owner = Owner()
data = Data(owner)
After script is finished I get warning message that Data destructor
shouldn't be
12 matches
Mail list logo