[Gdal-dev] Building SWIG Java with Visual C++ 8.0

Andrea Aime aaime at openplans.org
Sun Mar 25 16:10:19 EDT 2007


Andrea Aime ha scritto:
> Mateusz Loskot ha scritto:
>> Hi,
>>
>> I tried to build SWIG Java bindings using Visual C++ 8.0 compiler
>> and I got errors from javac about missing symbols.
>>
>> Here is detailed log of all my steps I took in the gdal\swig directory:
>>
>> http://mateusz.loskot.net/tmp/gdal-java-build.txt
>>
>> Am I doing anything wrong or the SWIG Java is incomplete in any way?
>>
>> I use following tools:
>>
>> SWIG 1.3.31
> 
> Hmmm... yeah, I already seen that issue when I tried to build gdal
> java bindings under Windows, which unfortunately failed later because
> java would not load the generated binding libraries.
> 
> Anyways, the following patch fixed the issue:
> 
> --- include/java/ogr_java.i     (revisione 11066)
> +++ include/java/ogr_java.i     (copia locale)
> @@ -46,6 +46,11 @@
>  /*
>   *
>   */
> +%pragma(java) jniclassimports=%{
> +import org.gdal.osr.SpatialReference;
> +import org.gdal.osr.CoordinateTransformation;
> +%}
> +
>  %pragma(java) moduleimports=%{
>  import org.gdal.osr.SpatialReference;
>  %}

Well, I went ahead and committed this patch, along with one
in Driver.i to make things compile for good (a void function,
deregister, was returning), and another small patch to makefiles
to make sure clean does not break if some bindings were not built
(it was breaking because of missing directories, rmdir exits with an
error code if the directory to be deleted is not there).

Cheers
Andrea



More information about the Gdal-dev mailing list