Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-02-05 22:17:25


----- Original Message -----
From: "LORIEN DUNN" <l.dunn_at_[hidden]>

> Hullo,
> I have some problems with this:
>
> BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is a gcc 2.95.2 bug
> workaround
> PyObject* to_python(Foo& p)
> {
> return boost::python::PyExtensionClassConverters::ptr_to_python(&p);
> }
> BOOST_PYTHON_END_CONVERSION_NAMESPACE
>
>
> 1) boost::python::PyExtensionClassConverters does not exist. Nor does
> boost::python::py_extension_class_converters, nor
> py_extension_class_converters. What is correcct these days?

Sorry! It's boost::python::python_extension_class_converters

I'll fix the documentation.

> 2) I got it compiling (after examing the source) with
> BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is a gcc 2.95.2 bug
> workaround
> PyObject* to_python(Transmitter& t)
> {
> return python_extension_class_converters<Transmitter,
> TransmitterPyCallback>::ptr_to_python(&t);
> }
> BOOST_PYTHON_END_CONVERSION_NAMESPACE
>
> but during linking I was told I have two definitions of
> "to_python(Transmitter& t)"
>
> Any hints?

Not a clue. There are no declarations of to_python() in the rest of the
source which accept a non-const reference. Is it possible you put this
definition in a header file and then included it in two source files? The
"inline" keyword usually helps with that ;-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk