c++项目加入JsonCpp解析json
1.去github下载jsonCpp jSONCpp地址 2.下载之后如图 3.执行python 脚本生成dist文件 4.将dist导入到c++项目中使用 5.具体使用方法 #include "json/json.h" #include "json-forwards.h" using namespace std; Json::Value json; Json::CharReaderBuilder builder; std::stringstream stream(strData); std::string errs; if (!Json::parseFromStream(builder, stream, &json, &errs)) { AfxMessageBox(_T("解析错误")); }else { std::string rescode = json.get("rescode", "UTF-8").asString(); std::string msg = json.get("msg", "UTF-8").asString(); std::cout << rescode << std::endl; if (rescode == "200") { const Json::Value dataDic = json["data"]; std::string liveIdTmp