Rapidjson无法复制`rapidjson :: Document`

时间:2014-09-27 13:42:59

标签: c++ rapidjson

我需要一个构造rapidjson::Document并返回的函数。但是当我用这个原型编写一个函数时:

rapidjson::Document progressToJson(const Progress& progress);

我收到此错误:

error LNK2019: unresolved external symbol "private: __thiscall rapidjson::GenericValue<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> >::GenericValue<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> >(class rapidjson::GenericValue<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> > const &)" (??0?$GenericValue@U?$UTF8@D@rapidjson@@V?$MemoryPoolAllocator@VCrtAllocator@rapidjson@@@2@@rapidjson@@AAE@ABV01@@Z) referenced in function "public: __thiscall rapidjson::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> >::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> >(class rapidjson::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator> > const &)" (??0?$GenericDocument@U?$UTF8@D@rapidjson@@V?$MemoryPoolAllocator@VCrtAllocator@rapidjson@@@2@@rapidjson@@QAE@ABV01@@Z)

似乎没有复制构造函数。我怎么解决这个问题?顺便说一句,当我用Eclipse编译它作为Android Native代码时,它编译并运行。我在Windows上使用MVS 2012时出现此错误。

1 个答案:

答案 0 :(得分:0)

传递一个空文档作为参数,并尝试使用其内存分配器对其进行解析:

void progressToJson(const Progress & progress, rapidjson::Document & doc);