简体   繁体   English

如何在不使用jsoncpp.dll的情况下使用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 . 我需要在程序中使用json数据,昨天我使用nuGet下载了它,对所有需要的代码进行了编码,并注释了jsoncpp.lib路径,但由于缺少jsoncpp.dll系统不允许我启动程序。 Does this mean i need to take the dll everywhere with my program? 这是否意味着我需要在程序中随处携带dll? 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 ? 或者,如果不可能,我可以使用哪些不需要dll的json库?

  • download amalgamation (all source is in one file) 下载合并 (所有源都在一个文件中)
  • add jsoncpp.cpp to your project jsoncpp.cpp添加到您的项目
  • uncomment #define JSON_IS_AMALGAMATION in json.h 取消注释#define JSON_IS_AMALGAMATION中的json.h
  • add #include "json/json.h" at the beginning of your source code 在源代码的开头添加#include "json/json.h"

Please use the latest source-code. 请使用最新的源代码。 The project has moved to GitHub . 该项目已移至GitHub cmake would probably solve your problem. cmake可能会解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM