[Gdal-dev] swig java: c/c++

Christine Spietz spietz at fh-bingen.de
Tue May 16 10:57:03 EDT 2006


Hi Ben

I'm using the CVS (gdal-cvs.2006.05.08.tar.gz) and there are the necessary 
c/c++-files in the .../swig/java-directory:
- gdal_wrap.cpp
- gdalconst_wrap.c
- ogr_wrap.cpp
- osr_wrap.cpp

But they are not compiled. On Linux you should get after a 'make built' in 
the swig/java directory some
lib*jni.so-files in swig/java/.libs
(look at 
http://lists.maptools.org/pipermail/gdal-dev/2006-February/007867.html)

Seems I misunderstood:
I thought by using swig(swig1.3.24 ) I will compile the existing sources.
I don't want to build the wrapper files themselves, I want to use/compile 
the existing ones!
Before installing swig "nothing" worked (look at 
http://lists.maptools.org/pipermail/gdal-dev/2006-May/008847.html).

So after your tip I made
'touch *.cpp'
'touch *.c'
in the swig/java directory and after that I run
'make build'

but I'm getting the same errors as before (see below).

Any other ideas?


Christine


> Unless you WANT to do the swig build, it should not be necessary, since
> checed into CVS are the generated c/c++ files from the original author,
> which should be generally useful.  They work under GNU/Linux from a
> week-old snapshot.
>
> In order to have 'make build' in swig/java not try to run swig run the
> following commands which in the java directory.
>
>Run the following to tell make that the source files are up to date and
>do not need rebuilding:
> touch *.cpp
> touch *.c
>
>Then run 'make build' and the lib<*>jni.so files should be built.

>Please let me know if there are any issues.

>Also, to build the wrapper file themselves, please use SWIG version
>1.3.27+

>
>>-----Original Message-----
>>From: gdal-dev-bounces at lists.maptools.org
>>[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of
>>Christine Spietz
>>Sent: Tuesday, May 16, 2006 3:46 AM
>>To: gdal-dev at lists.maptools.org
>>Subject: Re: [Gdal-dev] swig java: c/c++
>>
>> Hi Frank,
>>
>> lot of thanks for your help!
>> After running "./config" in GDAL_HOME I got the GDALmake.opt.
>> Then I installed swig1.3.24 and tried to run "make build" in the
>> swig/java-directory.
>>
>> The compiling process for the c/c++-sources starts, but there
>>seem to be
>> some errors in the c++-code (?)
>>
>> error:
>> ....
>> gdal_wrap.cpp:1774:error:GDALDriverShadow_get_ShortName was
>>not declared in
>> this scope
>> ....
>> gdal_wrap.cpp:1808:error:GDALDriverShadow_get_HelpTopic was
>>not declared in
>> this scope
>> ....
>> gdal_wrap.cpp:2721:error:GDALDatasetShadow_get_RasterXSize
>>was not declared
>> in this scope
>> ....
>> gdal_wrap.cpp:2736:error:GDALDatasetShadow_get_RasterYSize
>>was not declared
>> in this scope
>> ....
>> gdal_wrap.cpp:2751:error:GDALDatasetShadow_get_RasterCount
>>was not declared
>> in this scope
>> ....
>> gdal_wrap.cpp:3209:error:GDALRasterBandShadow_get_XSize was
>>not declared in
>> this scope
>> ....
>> gdal_wrap.cpp:3224:error:GDALRasterBandShadow_get_YSize was
>>not declared in
>> this scope
>> ....
>> gdal_wrap.cpp:3239:error:GDALRasterBandShadow_get_DataType
>>was not declared
>> in this scope
>> ...
>> make: *** [gdal_wrap.o] Error 1
>>
>> Does anybody know, what to do to get the ./libs/lib*jni.so
>>files which I
>> need to get the java bindings running?
>>
>>
>> Beste regards
>>
>> Christine
>>
>>
>>> ----- Original Message ----- 
>>> From: "Frank Warmerdam" <warmerdam at pobox.com>
>>> To: "Christine Spietz" <spietz at fh-bingen.de>
>>> Cc: <gdal-dev at lists.maptools.org>
>>> Sent: Thursday, May 11, 2006 8:28 PM
>>> Subject: Re: [Gdal-dev] swig java: c/c++
>>>
>>>
>>>> Christine Spietz wrote:
>>>>> The problem:
>>>>> If I go into the swig/java directoty and call 'make build'
>>there is the
>>>>> first error:
>>>>> ###
>>>>> [ GNUmakefile:3 ../../GDALmake.opt: No such file or directory ]
>>>>> ###
>>>>> => So I changed in swig/java/GNUmakefile the first include from
>>>>> 'GDALmake.opt' to 'GDALmake.opt.in'. This will solve this problem.
>>>>
>>>> Christine,
>>>>
>>>> A more appropriate solution is to run configure to make the
>>GDALmake.opt
>>>> file from GDALmake.opt.in.
>>>>
>>>>
>>>>> Then again I call 'make build' and the next error occurs:
>>>>> ###
>>>>> swig -Wall -I../inculde -I ../include/java -outdir
>>>>> "org/gdal/gdal" -package
>>>>> "org.gdal.gdal" -[@abs_top_builddir -c++ -java -o
>>gdal_wrap.cpp gdal.i
>>>>> ... /bin/sh: swig: command not found
>>>>> make: *** [gdal_wrap.cpp] Error 127
>>>>> ###
>>>>
>>>> You will need to have SWIG installed to generate the
>>bindings.  I believe
>>>> a very recent version is required though I'm not sure exactly what
>>>> version
>>>> that is.
>>>>
>>>>   http://www.swig.org/
>>>>
>>>> I'm afraid building the java bindings is likely to be complicated.
>>>>
>>>> Best regards,
>>>> -- 
>>>>
>>---------------------------------------+-----------------------
>>---------------
>>>> I set the clouds in motion - turn up   | Frank Warmerdam,
>>>> warmerdam at pobox.com
>>>> light and sound - activate the windows |
> http://pobox.com/~warmerdam
>>>> and watch the world go round - Rush    | President OSGF,
>>http://osgeo.org
>>>>
>>>
>>
>>_______________________________________________
>>Gdal-dev mailing list
>>Gdal-dev at lists.maptools.org
>>http://lists.maptools.org/mailman/listinfo/gdal-dev
>>
> 




More information about the Gdal-dev mailing list