0
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 ?

user3883435
  • 13
  • 2
  • 5
  • 3
    Perhaps you want to compile *jsoncpp* as a *static* library. I don't know if the license permit that (i.e. redistributions of binaries linked to a static library), and I don't know how to do that on Windows. I would believe you should distribute the `.dll` with your program. Read about [DLL hell](https://en.wikipedia.org/wiki/DLL_Hell) – Basile Starynkevitch Jul 28 '14 at 08:08
  • That's the problem: i dont want people to take the dll everywhere with my program when i share it. I hate when people do that and dont want to do myself. Its just small program 2000 rows of code, not big project with installer and thousands features. – user3883435 Jul 28 '14 at 11:01
  • You could make your program free software and publish your source code. The burden of compiling JSONCPP is then left to the user. – Basile Starynkevitch Jul 28 '14 at 11:04

2 Answers2

3
  • 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
Sga
  • 3,608
  • 2
  • 36
  • 47
  • if your compiler can't find `json/json.h` be sure to add its _parent folder_ to your include paths – Sga Jul 28 '14 at 13:56
  • You don't need to uncomment `#define JSON_IS_AMALGAMATION`. The amalgamated header sets that up for you. You need only to set your include path properly. – cdunn2001 Feb 17 '15 at 01:18
0

Please use the latest source-code. The project has moved to GitHub. cmake would probably solve your problem.

cdunn2001
  • 17,657
  • 8
  • 55
  • 45