Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-05-14 19:32:54


Hi Ralf,

You might try adding some function declarations in the calling functions,
e.g.:

    friend T* from_python(PyObject* obj, boost::python::type<T*>)
    {
        T* non_null_from_python(PyObject*, boost::python::type<T*>);
        if (obj == Py_None)
            return 0;
        else
            return non_null_from_python(obj, boost::python::type<T*>());
    }
    ...
    // Convert to T&
    friend T& from_python(PyObject* p, boost::python::type<T&>)
        { T* non_null_from_python(PyObject*, boost::python::type<T*>);
          return
*boost::python::detail::check_non_null(non_null_from_python(p,
boost::python::type<T*>())); }

Best of luck,
Dave

----- Original Message -----
From: <rwgk_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, May 04, 2001 9:38 PM
Subject: [boost] Boost.Python compilation problem with latest Compaq comiler

> The latest Compaq C++ compiler generates an error when compiling
> Boost.Python (CVS snapshot):
>
> Compaq C++ V6.3-008 for Compaq Tru64 UNIX V5.0A (Rev. 1094)
> Compiler Driver V6.3-008 (cxx) cxx Driver
>
> cxx -I/net/cci/rwgk/boost -I/usr/local/Python-
> 1.5.2/include/python1.5 -std strict_ansi -msg_disable 186,450,1115 -
> g -c comprehensive.cpp
> cxx:
> Error: /net/cci/rwgk/boost/boost/python/detail/extension_class.hpp,
> line 244:
> identifier "non_null_from_python" is undefined
> detected during instantiation of class
> "boost::python::python_extension_class_converters<
> T, U>
> [with T=bpl_test::Foo, U=bpl_test::FooCallback]"
> at line
> 187 of "comprehensive.hpp"
> return non_null_from_python(obj, boost::python::type<T*>
> ());
> -------------------^
>
>
> I tried to fully qualify non_null_from_python:
>
> cxx -I/net/cci/rwgk/boost -I/usr/local/Python-
> 1.5.2/include/python1.5 -std strict_ansi -msg_disable 186,450,1115 -
> g -c comprehensive.cpp
> cxx:
> Error: /net/cci/rwgk/boost/boost/python/detail/extension_class.hpp,
> line 244:
> namespace "boost::python" has no
> member "non_null_from_python"
> detected during instantiation of class
> "boost::python::python_extension_class_converters<
> T, U>
> [with T=bpl_test::Foo, U=bpl_test::FooCallback]"
> at line
> 187 of "comprehensive.hpp"
> return BOOST_PYTHON_CONVERSION::non_null_from_python(obj,
> boost::pyt
> hon::type<T*>());
> --------------------------------------------^
>
>
> Another try (same result):
>
> template <class T, class U>
> T* non_null_from_python(PyObject* obj, boost::python::type<T*>);
>
> What else could I try to convince the compiler that
> non_null_from_python()
> is declared?
>
> Thanks!
> Ralf
>
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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