[Gdal-dev] Building GDAL + JNI bindings using MinGW

Gibbs, Solomon Solomon_Gibbs at sra.com
Wed Aug 1 14:49:15 EDT 2007


Hi, 

I am trying to build the GDAL Java bindings using MingGW on Windows.
Everything appears to be compiling okay, although for whatever reason
the java wrappers need to be built with mingw32-make and not the MSYS
make, while the main GDAL library builds with MSYS make and not
mingw32-make.

The problem is that as near as I can tell, the JNI dlls are failing to
load correctly into the Java runtime. At the first reference to any
method in gdalJNI or gdalConstJNI, the JVM throws an unsatisfied link
error (e.g.):

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:198)

I've copied all the JNI dlls and libgdal-1 to a single directory and the
JVM appears to be picking them up when System.loadLibrary is called. My
only guess is that some symbols may being mangled somewhere and the
method names in the dll are inconsistent with those in the java class.
I'm not too sure how to check this.

I'd like to stick with MinGW if at all possible. I'm much more
comfortable with gcc and friends than Visual Studio.

My questions are:

1. Does anyone have any recent experience building the JNI libraries for
Windows? I notice that they appear to be in sort of a limbo state -- not
part of the main build or the binary distribution.

2. Is using MinGW a problem? The GDAL website says that it works, but is
not supported and that libtool is a problem. The new version of the
MinGW binutils includes libtool 1.5.2 and appears to work okay (or at
least without producing error messages...)

3. Any suggestions for diagnosing the problem? I ran the Visual Studio
"depends" tool and it appears that all the dependent dlls are in place.


Thanks,

Solomon 
 
    




More information about the Gdal-dev mailing list