I have tried the following code - but getting a compile error
rapidjson::Document details;
details.SetObject();
std::string s = "kjfhgdkgjhfkjfhj";
details.AddMember("farm", s, details.GetAllocator());
What is the correct way of creating a member with a std::string as a value
To allow for rapidjson to work with std::strings, add the following pre-processor directive to the beginning of your program.
The following program worked properly for me after adding the above line.