1

I downloaded postgis-2.1.0SVN, autogen, configured and make, but 'make check' fails and the logs end with

psql:/home/admin/postgis-2.1.0SVN/regress/00-regress-install/share/contrib/postgis/postgis.sql:47: ERROR: could not load library "/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: undefined symbol: json_tokener_errors

I ran ldd on postgis-2.1.so and got

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

I have json-c built and installed from the github project

the ./configure response ended with:

  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

but I am suspicious of this last line from the configure output:

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
johnlockwood
  • 247
  • 2
  • 7
  • I was able to work around dealing with json-c and compiling postgis2.1 by using the the package manager installed postgis2.0. and to still use the updated tiger geocoder from postgis2.1SVN – johnlockwood Nov 21 '12 at 18:08

2 Answers2

2

I got same errors on my ubuntu 12.10 too and resolved to link libjson to 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

reconfigure and compile again. Hope that helps

lontongcorp
  • 138
  • 1
  • 8
1

I had the same error, I was trying to install from the git source json-c. I resolved it installing json-c from the repository, and json-c-devel. Then libconfig command. Then go to postgis folder

./configure 
make
make install
make test

Hope it helps you.

Great day!

Mario T.

mariofertc
  • 383
  • 2
  • 7