samedi 27 octobre 2018

Using JsonCpp to return data to python with pybind11 produces Symbol not found in python

I am attempting to use JsonCpp in order to parse some data before returning it to python (using pybind11).

I have managed to get the make file cooperating with recognizing JsonCpp, but have been unable so far to get rid of the following error when calling the method in python:

ImportError: dlopen(/PATH/REDACTED/project.cpython-36m-darwin.so, 2): Symbol not found: __ZN4Json5ValueC1ENS_9ValueTypeE

Expected in: flat namespace Referenced from: /PATH/REDACTED/project.cpython-36m-darwin.so

It appears to have an issue with anything from the JsonCpp library.

void callhome(pybind11::object site, std::string user_name)
{
    pybind11::object page = site.attr("Pages").attr("__getitem__")("User:" + user_name + "/status");
    std::string text = string(py::str(page.attr("text")()));
    Json::Value root;
   /* Json::Reader reader;
    bool parsingSuccessful = reader.parse( text, root );
    if ( !parsingSuccessful )
    {
        cout << "Error parsing the string" << endl;
    }

    const Json::Value mynames = root["run"];

    for ( int index = 0; index < mynames.size(); ++index )
    {
       // py::print()
        cout << mynames[index] << endl;
    }*/
}

Any ideas would be greatly appreciated!

Aucun commentaire:

Enregistrer un commentaire