首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rapidjson无法复制`rapidjson::Document`

Rapidjson无法复制`rapidjson::Document`
EN

Stack Overflow用户
提问于 2014-09-27 21:42:59
回答 1查看 1.2K关注 0票数 1

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

代码语言:javascript
复制
rapidjson::Document progressToJson(const Progress& progress);

我得到了这个错误:

代码语言:javascript
复制
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原生代码时,它会编译并工作。我在Windows上使用MVS 2012时遇到此错误。

EN

回答 1

Stack Overflow用户

发布于 2018-12-02 16:44:06

传递一个空文档作为参数,并尝试用它的内存分配器解析成它:

代码语言:javascript
复制
void progressToJson(const Progress & progress, rapidjson::Document & doc);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26075268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档