I can't use libjson like n.push_back(JSONNode("RootA", "Hello World"));

196 views Asked by At

I download libjson_7.6.1.zip from http://sourceforge.net/projects/libjson/, and compile it to generate a library. After I create a new project , I find that I can't use libjson like that: n.push_back(JSONNode("RootA", "Hello World"));//(JSONNode n(JSON_NODE);)

The error message shows that “JSONNode::JSONNode”: On an overloaded function call is not clear

It suggests JSONNode constructors as follows:

“JSONNode::JSONNode(const json_string &,bool)”

“JSONNode::JSONNode(const json_string &,json_number)”

“JSONNode::JSONNode(const json_string &,json_int_t)”

Is there something wrong with my libjson version ?

Or What did I miss ?

Thanks for your help!

1

There are 1 answers

0
yskyj On

I find solution is to note "#define JSON_LIBRARY" in JSONOptions.h

I create a cpp file while I use c-library, I think that's the reason