[postgis-tickets] [PostGIS] #2213: postgis-2.1.so: undefined symbol: json_tokener_errors
PostGIS
trac at osgeo.org
Thu Jun 20 13:49:20 PDT 2013
#2213: postgis-2.1.so: undefined symbol: json_tokener_errors
---------------------+------------------------------------------------------
Reporter: mloskot | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone:
Component: postgis | Version: trunk
Keywords: json-c |
---------------------+------------------------------------------------------
Comment(by kashif):
Yes so that's what I tried initially, a one line change:
-AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=yes], [], [])
+AC_SEARCH_LIBS([json_object_get], [json-c json], [HAVE_JSON=yes], [], [])
And it finds the newer json-c, but when compiling I get a linker error:
$ make
....
st_2d.o gserialized_gist_nd.o gserialized_estimate.o geography_inout.o
geography_btree.o geography_measurement.o
geography_measurement_trees.o geometry_inout.o
-L/usr/local/Cellar/postgresql/9.2.4/lib -L/usr/local/Cellar/ossp-
uuid/1.6.2/lib -Wl,-dead_strip_dylibs ../libpgcommon/libpgcommon.a
../liblwgeom/.libs/liblwgeom.a
-L/usr/local/Cellar/geos/3.3.8/lib -lgeos_c -lproj -ljson -lxml2
-bundle_loader
/usr/local/Cellar/postgresql/9.2.4/bin/postgres
Undefined symbols for architecture x86_64:
"_json_object_array_get_idx", referenced from:
_parse_geojson in liblwgeom.a(lwin_geojson.o)
_parse_geojson_coord in liblwgeom.a(lwin_geojson.o)
"_json_object_array_length", referenced from:
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[1]: *** [postgis-2.2.so] Error 1
make: *** [all] Error 1
and it seems that the -Wl,-dead_strip_dylibs flag is striping out the
libjson-c which is linked into the the older libjson shared lib:
$ otool -L libjson.0.dylib
libjson.0.dylib:
/usr/local/lib/libjson.0.dylib (compatibility version 2.0.0, current
version 2.0.0)
/usr/local/lib/libjson-c.2.dylib (compatibility version 3.0.0, current
version 3.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 169.3.0)
I have an issue about it on github:
https://github.com/json-c/json-c/issues/79
Hope this helps.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2213#comment:19>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list