[gdal-dev] Cannot build Java bindings in Linux (1.4.2, 1.4.4, 1.5.1)

Michael Wooten mwoote01 at harris.com
Tue May 27 10:06:41 EDT 2008


I receive the following error when trying to build the GDAL Java bindings in
Linux (Redhat Enterprise 6):

gdal_wrap.cpp: In function `_jstring*
Java_org_gdal_gdal_gdalJNI_get_1Driver_1ShortName(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:1867: error: `GDALDriverShadow_get_ShortName' was not declared in
this scope

Many more of a similar error occur. Below is a complete dump from "make".
I've modified java.opt to have correct paths for Java, ant, and the Java
includes directories (Java 1.6.0_04). The same error statements occur for GDAL
1.4.2, 1.4.4, and 1.5.1.

Any suggestions?

-Michael

Complete "make" error output:

cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid
for C/ObjC but not for C++
gdal_wrap.cpp: In function `_jstring*
Java_org_gdal_gdal_gdalJNI_get_1Driver_1ShortName(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:2122: error: `GDALDriverShadow_get_ShortName' was not declared in
this scope
gdal_wrap.cpp:2122: warning: unused variable 'GDALDriverShadow_get_ShortName'
gdal_wrap.cpp: In function `_jstring*
Java_org_gdal_gdal_gdalJNI_get_1Driver_1LongName(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:2139: error: `GDALDriverShadow_get_LongName' was not declared in
this scope
gdal_wrap.cpp:2139: warning: unused variable 'GDALDriverShadow_get_LongName'
gdal_wrap.cpp: In function `_jstring*
Java_org_gdal_gdal_gdalJNI_get_1Driver_1HelpTopic(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:2156: error: `GDALDriverShadow_get_HelpTopic' was not declared in
this scope
gdal_wrap.cpp:2156: warning: unused variable 'GDALDriverShadow_get_HelpTopic'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Dataset_1RasterXSize(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:3467: error: `GDALDatasetShadow_get_RasterXSize' was not declared
in this scope
gdal_wrap.cpp:3467: warning: unused variable 'GDALDatasetShadow_get_RasterXSize'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Dataset_1RasterYSize(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:3482: error: `GDALDatasetShadow_get_RasterYSize' was not declared
in this scope
gdal_wrap.cpp:3482: warning: unused variable 'GDALDatasetShadow_get_RasterYSize'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Dataset_1RasterCount(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:3497: error: `GDALDatasetShadow_get_RasterCount' was not declared
in this scope
gdal_wrap.cpp:3497: warning: unused variable 'GDALDatasetShadow_get_RasterCount'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Band_1XSize(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:4141: error: `GDALRasterBandShadow_get_XSize' was not declared in
this scope
gdal_wrap.cpp:4141: warning: unused variable 'GDALRasterBandShadow_get_XSize'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Band_1YSize(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:4156: error: `GDALRasterBandShadow_get_YSize' was not declared in
this scope
gdal_wrap.cpp:4156: warning: unused variable 'GDALRasterBandShadow_get_YSize'
gdal_wrap.cpp: In function `jint
Java_org_gdal_gdal_gdalJNI_get_1Band_1DataType(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:4171: error: `GDALRasterBandShadow_get_DataType' was not declared
in this scope
gdal_wrap.cpp:4171: warning: unused variable 'GDALRasterBandShadow_get_DataType'
gdal_wrap.cpp: In function `void
Java_org_gdal_gdal_gdalJNI_set_1TermProgress(JNIEnv*, _jclass*, jlong)':
gdal_wrap.cpp:5604: error: assignment of function `int GDALTermProgress(double,
const char*, void*)'
gdal_wrap.cpp:5604: error: cannot convert `int (*)(double, const char*, void*)'
to `int ()(double, const char*, void*)' in assignment
make: *** [gdal_wrap.o] Error 1




More information about the gdal-dev mailing list