1

I need a function that constructs a rapidjson::Document and returns. But when I write a function with this prototype:

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

I get this error:

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)

Seems there is not copy constructor. How can I solve this problem? BTW when I compile this with Eclipse as an Android Native code, it compiles and works. I get this error with MVS 2012 on Windows.

Narek
  • 38,779
  • 79
  • 233
  • 389

1 Answers1

0

Pass an empty document as argument and try to parse into it with its memory allocator:

void progressToJson(const Progress & progress, rapidjson::Document & doc);
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
Roman
  • 21
  • 5