Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RapidJson undefined reference

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&)'

I am facing this error while using rapidjson library in cocos2dX.

like image 982
Arvind Kanjariya Avatar asked Oct 20 '22 12:10

Arvind Kanjariya


1 Answers

This question was asked a while ago, recording the answer here for anyone else with the same problem.

If you are passing a rapidjson::Document into a function, try passing by reference. i.e. instead of void doSomething(rapidjson::Document doc) write void doSomething(rapidjson::Document &doc). I think there is an issue with using the rapidjson::Document copy constructor.

like image 166
user3738806 Avatar answered Oct 23 '22 01:10

user3738806