[gdal-dev] Java SWIG won't build

Gregor at HostGIS gregor at hostgis.com
Tue Aug 17 16:31:08 EDT 2010


Hey guys. I'm trying to build the Java SWIG wrapper on GDAL 1.6.4 I get 
this. Any ideas?

$ make build
mkdir -p org/gdal/gdal
mkdir -p org/gdal/gdalconst
mkdir -p org/gdal/ogr
mkdir -p org/gdal/osr
g++ -fPIC -fPIC -D_FILE_OFFSET_BITS=64 -fPIC  -Wall 
-Wdeclaration-after-statement  -I/tmp/gdal-1.6.2/port 
-I/tmp/gdal-1.6.2/gcore -I/tmp/gdal-1.6.2/alg -I/tmp/gdal-1.6.2/ogr 
-I/tmp/gdal-1.6.2/ogr/ogrsf_frmts -I/usr/local/jdk1.6.0_17/include 
-I/usr/local/jdk1.6.0_17/include/linux -c gdal_wrap.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is 
valid for C/ObjC but not for C++
g++ -shared  -L/tmp/gdal-1.6.2 -lgdal  -L/usr/lib -lgeos_c -L/usr/lib 
-lexpat -L/usr/lib -lxerces-c -lpthread -L/usr/lib -lNCSEcw -lNCSCnet 
-lNCSUtil -L/usr/lib -lhdf5  -L/usr/lib -lmfhdf -ldf -lsz -L/usr 
-L/usr/lib -lnetcdf -lpq -L/usr/lib -lpq -lz -L/usr -L/usr/lib -pthread 
-lm -lrt -ldl    -lcurl -L/tmp/Geo_DSDK-7.0.0.2167/lib/Release 
-L/tmp/Geo_DSDK-7.0.0.2167/3rd-party/lib/Release -lltidsdk -lpthread 
-llt_kakadu   gdal_wrap.o -o libgdaljni.so
g++ -fPIC -fPIC -D_FILE_OFFSET_BITS=64 -fPIC  -Wall 
-Wdeclaration-after-statement  -I/tmp/gdal-1.6.2/port 
-I/tmp/gdal-1.6.2/gcore -I/tmp/gdal-1.6.2/alg -I/tmp/gdal-1.6.2/ogr 
-I/tmp/gdal-1.6.2/ogr/ogrsf_frmts -I/usr/local/jdk1.6.0_17/include 
-I/usr/local/jdk1.6.0_17/include/linux -c ogr_wrap.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is 
valid for C/ObjC but not for C++
g++ -shared  -L/tmp/gdal-1.6.2 -lgdal  -L/usr/lib -lgeos_c -L/usr/lib 
-lexpat -L/usr/lib -lxerces-c -lpthread -L/usr/lib -lNCSEcw -lNCSCnet 
-lNCSUtil -L/usr/lib -lhdf5  -L/usr/lib -lmfhdf -ldf -lsz -L/usr 
-L/usr/lib -lnetcdf -lpq -L/usr/lib -lpq -lz -L/usr -L/usr/lib -pthread 
-lm -lrt -ldl    -lcurl -L/tmp/Geo_DSDK-7.0.0.2167/lib/Release 
-L/tmp/Geo_DSDK-7.0.0.2167/3rd-party/lib/Release -lltidsdk -lpthread 
-llt_kakadu   ogr_wrap.o -o libogrjni.so
gcc -fPIC -fPIC -D_FILE_OFFSET_BITS=64 -fPIC  -Wall 
-Wdeclaration-after-statement  -I/tmp/gdal-1.6.2/port 
-I/tmp/gdal-1.6.2/gcore -I/tmp/gdal-1.6.2/alg -I/tmp/gdal-1.6.2/ogr 
-I/tmp/gdal-1.6.2/ogr/ogrsf_frmts -I/usr/local/jdk1.6.0_17/include 
-I/usr/local/jdk1.6.0_17/include/linux -c gdalconst_wrap.c
g++ -shared  -L/tmp/gdal-1.6.2 -lgdal  -L/usr/lib -lgeos_c -L/usr/lib 
-lexpat -L/usr/lib -lxerces-c -lpthread -L/usr/lib -lNCSEcw -lNCSCnet 
-lNCSUtil -L/usr/lib -lhdf5  -L/usr/lib -lmfhdf -ldf -lsz -L/usr 
-L/usr/lib -lnetcdf -lpq -L/usr/lib -lpq -lz -L/usr -L/usr/lib -pthread 
-lm -lrt -ldl    -lcurl -L/tmp/Geo_DSDK-7.0.0.2167/lib/Release 
-L/tmp/Geo_DSDK-7.0.0.2167/3rd-party/lib/Release -lltidsdk -lpthread 
-llt_kakadu   gdalconst_wrap.o -o libgdalconstjni.so
g++ -fPIC -fPIC -D_FILE_OFFSET_BITS=64 -fPIC  -Wall 
-Wdeclaration-after-statement  -I/tmp/gdal-1.6.2/port 
-I/tmp/gdal-1.6.2/gcore -I/tmp/gdal-1.6.2/alg -I/tmp/gdal-1.6.2/ogr 
-I/tmp/gdal-1.6.2/ogr/ogrsf_frmts -I/usr/local/jdk1.6.0_17/include 
-I/usr/local/jdk1.6.0_17/include/linux -c osr_wrap.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is 
valid for C/ObjC but not for C++
g++ -shared  -L/tmp/gdal-1.6.2 -lgdal  -L/usr/lib -lgeos_c -L/usr/lib 
-lexpat -L/usr/lib -lxerces-c -lpthread -L/usr/lib -lNCSEcw -lNCSCnet 
-lNCSUtil -L/usr/lib -lhdf5  -L/usr/lib -lmfhdf -ldf -lsz -L/usr 
-L/usr/lib -lnetcdf -lpq -L/usr/lib -lpq -lz -L/usr -L/usr/lib -pthread 
-lm -lrt -ldl    -lcurl -L/tmp/Geo_DSDK-7.0.0.2167/lib/Release 
-L/tmp/Geo_DSDK-7.0.0.2167/3rd-party/lib/Release -lltidsdk -lpthread 
-llt_kakadu   osr_wrap.o -o libosrjni.so
cp ./.libs/*.so ./
cp: cannot stat `./.libs/*.so': No such file or directory
make: [build] Error 1 (ignored)
ant
Buildfile: /tmp/gdal-1.6.2/swig/java/build.xml

compile:
     [javac] Compiling 48 source files to 
/tmp/gdal-1.6.2/swig/java/build/classes
     [javac] 
/tmp/gdal-1.6.2/swig/java/org/gdal/gdal/MajorObject.java:71: 
SetMetadataItem(java.lang.String,java.lang.String,java.lang.String) is 
already defined in org.gdal.gdal.MajorObject
     [javac]   public int SetMetadataItem(String name, String value, 
String domain) {
     [javac]              ^
     [javac] 1 error

BUILD FAILED
/tmp/gdal-1.6.2/swig/java/build.xml:10: Compile failed; see the compiler 
error output for details.

Total time: 1 second
make: *** [build] Error 1


-- 
HostGIS, Open Source solutions for the global GIS community
Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
    Network+   Server+   A+   Security+   Linux+
    PHP   PostgreSQL   MySQL   DHTML/JavaScript/AJAX

"No one cares if you can back up — only if you can recover."


More information about the gdal-dev mailing list