0

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!

yskyj
  • 141
  • 1
  • 12
  • You trying to push: JSONNode("RootA", "Hello World") which is basically: JSONNode(const json_string&, const char*) And if the compiler suggests you: - “JSONNode::JSONNode(const json_string &,bool)” - “JSONNode::JSONNode(const json_string &,json_number)” - “JSONNode::JSONNode(const json_string &,json_int_t)” then why not to change the second paramter to either int or bool? – Tanuki Aug 09 '14 at 05:07
  • Not that I could help you, but can you provide a URL for that libjson? Reason is that the link associated with the "libjson" tag is for a different library for use in C. – Ulrich Eckhardt Aug 09 '14 at 06:54

1 Answers1

0

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

yskyj
  • 141
  • 1
  • 12