[gdal-dev] GDAL / Java bindings : Undefined symbol CPLLoggingErrorHandler in libgdaljni.so

Mathieu Coudert mathieu.coudert at gmail.com
Fri Aug 3 03:05:31 PDT 2012


Hi,

Running GDAL with Java binding I am facing an issue with an undefined
symbol: CPLLoggingErrorHandler in libgdaljni.so.

First I compiled GDAL 1.9.1 with Java support.
Then I followed the Java building instructions on Unix [1].
Everything seems to be correct, my ant build is successful.
However, running a make test or trying to execute the gdalinfo class I'm
facing an UnsatisfiedLinkError java exception due to the undefined
CPLLoggingErrorHandler symbol in libgdaljni.so

Any ideas how to deal with this issue would be appreciated.

I'm running GDAL 1.9.1 on top of Ubuntu 12.04 64bits (SWIG 2.0.4).

Oracle JDK 7 :
*java version "1.7.0_05"*
*Java(TM) SE Runtime Environment (build 1.7.0_05-b05)*
*Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)*

Please find below full traces of my errors :

*$ make test*
*rm -rf tmp_test*
*mkdir tmp_test*
*cp  test_data/byte.tif tmp_test*
*java -Djava.library.path=. -cp gdal.jar:build/apps GDALOverviews
tmp_test/byte.tif "NEAREST" 2 4*
*Native library load failed.*
*java.lang.UnsatisfiedLinkError:
/[myHome]/sources/gdal-1.9.1/swig/java/libgdaljni.so:
/[myHome]/sources/gdal-1.9.1/swig/java/libgdaljni.so: undefined symbol:
CPLLoggingErrorHandler*
*Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.gdal.gdal.gdalJNI.AllRegister()V*
* at org.gdal.gdal.gdalJNI.AllRegister(Native Method)*
* at org.gdal.gdal.gdal.AllRegister(gdal.java:475)*
* at GDALOverviews.main(GDALOverviews.java:70)*
*make: *** [test] Error 1*


*$ echo $LD_LIBRARY_PATH*
*/[myHome]/sources/gdal-1.9.1/swig/java*
*
*
*$ java -classpath `pwd`/gdal.jar:`pwd`:`pwd`/build/apps gdalinfo*
*Native library load failed.*
*java.lang.UnsatisfiedLinkError:
/[myHome]/sources/gdal-1.9.1/swig/java/libgdaljni.so:
/[myHome]/sources/gdal-1.9.1/swig/java/libgdaljni.so:
undefined symbol: CPLLoggingErrorHandler*
*Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.gdal.gdal.gdalJNI.AllRegister()V*
* at org.gdal.gdal.gdalJNI.AllRegister(Native Method)*
* at org.gdal.gdal.gdal.AllRegister(gdal.java:475)*
* at gdalinfo.main(gdalinfo.java:87)*

Cheers,
Mathieu

[1] http://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120803/e1d8ac73/attachment.html>


More information about the gdal-dev mailing list