我下载了postgis-2.1.0SVN,autogen,已配置并生成,但“make check”失败,日志以
结尾PSQL:/home/admin/postgis-2.1.0SVN/regress/00-regress-install/share/contrib/postgis/postgis.sql:47: 错误:无法加载库 “/home/admin/postgis-2.1.0SVN/regress/00-regress-install/lib/postgis-2.1.so”: /home/admin/postgis-2.1.0SVN/regress/00-regress-install/lib/postgis-2.1.so: 未定义的符号:json_tokener_errors
我在postgis-2.1.so上运行了ldd并得到了
linux-vdso.so.1 => (0x00007fff055ff000)
libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00007ffcc79fd000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007ffcc77ac000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007ffcc7450000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffcc7091000)
libgeos-3.3.6.so => /usr/local/lib/libgeos-3.3.6.so (0x00007ffcc6d08000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffcc6a07000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffcc67f1000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffcc64f5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffcc62f0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffcc60d9000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffcc7ecb000
我从github项目构建并安装了json-c
./configure响应以:
结束 PostGIS is now configured for x86_64-unknown-linux-gnu
-------------- Compiler Info -------------
C compiler: gcc -g -O2
C++ compiler: g++ -g -O2
SQL preprocessor: /usr/bin/cpp -traditional-cpp -P
-------------- Dependencies --------------
GEOS config: /usr/local/bin/geos-config
GEOS version: 3.3.6
PostgreSQL config: /usr/bin/pg_config
PostgreSQL version: PostgreSQL 9.1.6
PROJ4 version: 48
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.7.8
JSON-C support: yes
PostGIS debug level: 0
Perl: /usr/bin/perl
--------------- Extensions ---------------
PostGIS Raster: disabled
PostGIS Topology: enabled
但我怀疑配置输出的最后一行:
checking json/json.h usability... yes
checking json/json.h presence... yes
checking for json/json.h... yes
checking for json_object_get in -ljson... no
答案 0 :(得分:2)
我的ubuntu 12.10上也出现了同样的错误,并决定将libjson链接到libjson-c
cd /usr/lib/
sudo mv libjson.so libjson.so.bak
sudo ln -s libjson-c.so.2.0.0 libjson.so
sudo ldconfig
重新配置并再次编译。 希望有所帮助
答案 1 :(得分:1)
我有同样的错误,我试图从git源json-c安装。我解决了从存储库和json-c-devel安装json-c的问题。然后是libconfig命令。 然后转到postgis文件夹
./configure
make
make install
make test
希望它对你有所帮助。
美好的一天!
Mario T。