Boost logo

Boost Users :

From: desai3_at_[hidden]
Date: 2007-08-30 16:58:28


I am trying to expose a C++ function in Python.

This function does not take any inputs, and it returns a structure which
consists of a string array and a multidimentional integer array.

When I try to compile it, it gives me following error:

c:\boost\boost/python/detail/caller.hpp(199) : error C2027: use of
undefined type
'boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<T>'
        with
        [
            T=result_t
        ]
        c:\boost\boost/python/detail/caller.hpp(176) : while compiling
class template member function 'PyObject
*boost::python::detail::caller_arity<1>::impl<F,Policies,Sig>::operator
()(PyObject *,PyObject *)'
        with
        [
            F=DQEasy *(__thiscall DQEasy::* )(void),
            Policies=boost::python::default_call_policies,
            Sig=boost::mpl::vector2<DQEasy *,DQEasy &>
        ]

/////////////

My function looks like this:

DQEasy*
DQEasy::RequestToResponse()
{
        int size(0);
        std::string user = "O066144";
        std::string url = "dataquery-dev.ny.jpmorgan.com:6555";

        DQP* request = getBaseRequest();

        addValidContext(request, user);

        std::string expressionList[] = {"DB(FHR,TB3,MIDYLD)","DB(FHR,TB6,MIDYLD)"};
        size = sizeof(expressionList)/sizeof(std::string);
        DQEasy::addExressions(request, expressionList, size);

        std::string outputTypeArray[] = {"data","stats"};
        size = sizeof(outputTypeArray)/sizeof(std::string);
        DQEasy::addOutputTypes(request, outputTypeArray, size);

        DQP *response = DQEasy::getResponse(request, url);
        DQEasy *output = DQEasy::parseDQP(response);

        return output;
}

#include <C:/boost/boost/python.hpp>
#include <C:/boost/boost/python/module.hpp>
#include <C:/boost/boost/python/def.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(DQEasy)
{
        //Export the class to Python
        class_<DQEasy>("DQEasy")
                .def("RequestToResponse", &DQEasy::RequestToResponse)
                ;
}

Any clue will be quite helpful. I apologize if the message is too long.

Thank you


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net