Search code examples
c++visual-c++jsoncpp

How to use jsoncpp without jsoncpp.dll?


strcpy(this->encoding, jsonvalue.get("encoding", "").asCString());

I need to work with json data in my program, yesterday i downloaded it using nuGet, coded all i needed, commented path to jsoncpp.lib but system doesnt allow me to start the program due to missing jsoncpp.dll. Does this mean i need to take the dll everywhere with my program? If so, im not happy with that so can i solve this? Or if its impossible, which json libraries that doesnt require dll can i use ?


Solution

    • download amalgamation (all source is in one file)
    • add jsoncpp.cpp to your project
    • uncomment #define JSON_IS_AMALGAMATION in json.h
    • add #include "json/json.h" at the beginning of your source code