in function rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::GenericDocument(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&):
error: undefined reference to 'rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::GenericValue(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&)'在使用cocos2dX中的rapidjson库时,我遇到了这个错误。
发布于 2014-06-14 02:53:07
这个问题是在一段时间前提出的,并在这里为其他有相同问题的人记录了答案。
如果要将rapidjson::Document传递给函数,请尝试按引用传递。即代替void doSomething(rapidjson::Document doc)写void doSomething(rapidjson::Document &doc)。我认为使用rapidjson::Document copy constructor有问题。
发布于 2015-05-20 09:38:09
不允许深度复制,请使用参考。比如
void parseJsonDocument(const char* data, rapidjson::Document& json);
const rapidjson::Value& itemValue = value["value"];https://stackoverflow.com/questions/22471567
复制相似问题