我正在尝试为 Centos 6.5 上的 REST 模块添加 JSON 支持
我已经安装了 json-c-devel 包,但是在编译 FreeRADIUS 时它抱怨找不到它:
[root@dhcp01]# ./configure --with-dhcp --with-experimental-modules
...
...
checking for json/json.h... yes
checking for json_c_version in -ljson-c in /usr/lib64... no
checking for json_c_version in -ljson-c... no
checking for json_c_version in -ljson-c in /usr/local/lib... no
checking for json_c_version in -ljson-c in /opt/lib... no
configure: WARNING: json-c libraries not found. Use --with-jsonc-lib-dir=<path>.
configure: WARNING: silently building without JSON support. requires: json-c
...
...
[root@dhcp01 lib64]# yum install json-c-devel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirror.xnet.co.nz
* epel: fedora.mirror.serversaustralia.com.au
* extras: centos.mirror.uber.com.au
* remi: remi.conetix.com.au
* updates: centos.mirror.serversaustralia.com.au
Setting up Install Process
Package json-c-devel-0.10-2.el6.x86_64 already installed and latest version
Nothing to do
我发现 JSON-C 库安装在 /usr/lib64:
usr/lib64/libjson.so
usr/lib64/libjson.so.0
usr/lib64/libjson.so.0.1.0
但似乎缺少 libjson-c.so,我认为这可能是问题所在。我也尝试过在编译时指定 /usr/lib64 作为 JSON-C 库路径,但结果相同:
./configure --with-dhcp --with-experimental-modules --with-jsonc-lib-dir=/usr/lib64
答案1
使用 v3.0.x 头,检查已修改为在其检查中包含 json_tokener_new 符号,该符号存在于旧版本的 JSON-C 中。或者,如果您从 src 构建 JSON-C,它应该是一个足够新的版本,可以正常工作。