Skip to content

Inserting an OFXJsonElement in another one #26

@cgiles

Description

@cgiles

Hi, I read this forum post : https://forum.openframeworks.cc/t/create-your-own-json-data-and-save-json-file/16560

And tried to reproduce the example with ofxJSON.

But when I use an ofxJsonElement as value for another OfxJsonElement, it compiles fine, but crash when the code is executed.

My code in ofApp.h :

ofxJSONElement list;
ofxJSONElement papa;

My code in ofApp.cpp::setup :

list["yolo"]["pit"] = 1;
list["yolo"]["put"] = "morteau";
list["yolo"]["pot"] = 1.36;
papa["lol"]=666;
list["yolo"]["pot"]["54"] = papa;
ofLog() << list ;

The error I got :

std::_Tree_comp_alloc<std::_Tmap_traits<Json::Value::CZString,Json::Value,std::lessJson::Value::CZString,std::allocator<std::pair<Json::Value::CZString
const ,Json::Value> >,0> >::_Myhead(...) returned 0x5C28F5C7.

I use of0.9.8 with vs2015.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions