Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anyone worked with JSON in C++ in Visual Studio 2010

I have only previously worked with C++ in Visual Studio development environment. Now I have been asked to receive and send data using JSON.

I have searched the internet but can't find any example of JSON being used by C++ in Visual Studio. If anyone has worked with JSON in C++ in Visual Studio 2010 please pass on the link.

like image 215
Dany Avatar asked Oct 10 '12 13:10

Dany


3 Answers

If you will install boost::spirit you can use this lib JSON Spirit. Works in with VS like a charm.

UPDATE Include json spirit directory and use

#include <json_spirit/json_spirit.h>
#include <json_spirit/json_spirit_reader_template.h>
#include <json_spirit/json_spirit_writer_template.h>
like image 141
Denis Ermolin Avatar answered Nov 02 '22 18:11

Denis Ermolin


JsonCpp is a C++ JSON parser that builds in VS according to their README.

like image 28
MK. Avatar answered Nov 02 '22 17:11

MK.


Apache Thrift supports JSON. This is a nice alternative, because in addition to JSON, you also get transport mechanisms (TCP sockets, etc) and optionally in a multi-threaded environment.

Here you can find info about JSON for windows.

Thrift is multi-platform, so it should work quite well with VS.

like image 1
Brady Avatar answered Nov 02 '22 17:11

Brady