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 ?

3
  • 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 Commented Jul 28, 2014 at 8: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. Commented Jul 28, 2014 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. Commented Jul 28, 2014 at 11:04

2 Answers 2

4
  • 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
Sign up to request clarification or add additional context in comments.

2 Comments

if your compiler can't find json/json.h be sure to add its parent folder to your include paths
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.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.