Jansson C解析器库中缺少库“ jansson_private_config.h”

时间:2019-03-28 13:06:28

标签: c

任何人都曾经使用jansson C-parser来解析JSON对象。我试图研究该库,因为我用它提供的示例程序对其进行了编译。添加了所需的头文件,但是缺少一个名为“ jansson_private_config.h”的头文件。我已经完全下载了该库,我不确定在哪里可以找到这个文件?

1 个答案:

答案 0 :(得分:0)

您可以在documentation中找到如何为Windows构建此库的方法:

  • 获取CMake和Visual Studio
  • 解压缩源

在命令行中

  • cd .../jansson-2.12
  • mkdir build
  • cd build
  • cmake -G "Visual Studio XX 20XX" ..

您应该完成


Alternate method

您还可以手动编辑jansson_config.h.in,而忽略定义HAVE_CONFIG_H,这将导致jansson_private_config.h被包含在.c文件中。

请注意,此#ifdef HAVE_CONFIG_H测试已在test_dump.c中被遗忘,如果不进行修复,它将无法编译。

修正提案(未测试):

+#ifdef HAVE_CONFIG_H
 #include "jansson_private_config.h"
+#endif
相关问题