各路大神,求教:
我使用rapidjson时,报以下错误:
/Applications/Cocos/frameworks/cocos2d-x-3.8/external/json/document.h:1038:22: No matching constructor for initialization of ‘rapidjson::GenericValue<rapidjson::UTF8, rapidjson::MemoryPoolAllocatorrapidjson::CrtAllocator >’
break的地方如下:
我使用的代码如下:
rapidjson::Document document;
document.SetObject();
rapidjson::Document::AllocatorType& allocator = document.GetAllocator();
document.AddMember("deviceUUID", getDeviceUUID(), allocator);
document.AddMember("deviceINFO", getDeviceINFO(), allocator);
document.AddMember("systemINFO", getSystemINFO(), allocator);
document.AddMember("systemVerion", getSystemVersion(), allocator);
document.AddMember("localINFO", getLocalINFO(), allocator);
document.AddMember("messageType", getMessageType(), allocator);
document.AddMember("token", getToken(), allocator);
document.AddMember("userID", getUserID(), allocator);
document.AddMember("timeStamp", getTimeStamp(), allocator);
document.AddMember("platformType", getPlatformType(), allocator);
StringBuffer buffer;
rapidjson::Writer<StringBuffer> writer(buffer);
document.Accept(writer);