我刚刚从 sourceforge.net 安装了 libjson。我尝试执行一个简单的程序但我得到了这个错误
‘JSONNode’ was not declared in this scope
这是代码
#include<iostream>
#include <libjson.h>
int main()
{
JSONNode n(JSON_NODE);
JSONNode c(JSON_ARRAY);
c.push_back(JSONNode("", 16));
c.push_back(JSONNode("", 43));
c.push_back(JSONNode("", 69));
n.push_back(c);
std::string jc = n.write_formatted();
std::cout<<jc<<std::endl;
return 0;
}
MI缺少一些头文件?