[Gdal-dev] Re: GDAL wince bindings?

Mateusz Loskot mateusz at loskot.net
Fri Oct 19 04:58:22 EDT 2007


Asaf Ben-Nathan wrote:
> Hello Mateusz, I wonder if you could possibly help me... I've
> compiled GDAL for wince, and I now need to create bindings to the C# 
> compact framework. I'm trying to use SWIG in the same way that the
> regular C# bindings have been made under win32, but I'm having
> problems getting the code wrapped properly.

Hi Asaf,

I've never tried to provide C# bindings to Windows CE port of GDAL.
But I know that there are some problems with SWIG in this matter.
I'm adding Tamas Szekeres to CC as he is also interested in such
bindings. Tamas is the author of C# bindings for GDAL (not WinCE port,
but "big" GDAL) and he is the C#/SWIG guru in our team.

BTW, I believe it would be reasonable to post this discussion to the
gdal-dev mailing list if you don't mind.

> I've taken a VERY simple example (one simple function) and managed to
> get it working after playing around with the SWIG interface output
> files (some of wrapper code in there isnt supported in CF or is
> altered, eg. ThreadStaticAttribute and ArgumentException) and I'm
> wondering if you know anything about how i can do this since at this
> rate it will take me longer to SWIG the entire GDAL library than to
> just write my own wrappers and PINVOKE each function seperately.

According to my knowledge, P/Invoke seems to be the most reasonable way
to go, but perhaps SWIG team has added .NET Compact Framework support
recently, which I'm not aware of.

> I'm also new to swig, and so I'm not sure of its exact 
> capabilities...supposedly typemaps can change the swig functionality
> but I have no idea where to start in this instance. Granted my
> problem is more SWIG related than GDAL related, and I've emailed the
> appropriate people on the SWIG side, but if I can get this working it
> will benefit the GDAL community too. I've mailed the GDAL-DEV mailing
> list a similar email to see if anyone there knows anything.

Ah, I see. Yes, that's a good idea.

> To be honest I'm praying that there is some relatively simple
> solution like giving swig certain extra parameters, or writing a few
> typemaps or something, but most likely I'm guessing it won't be that
> simple or you guys would have already done it, but if you could help
> me out and point me in the right direction I would greatly appreciate
> it (and of course you could add the code to the GDAL source tree once
> its done).

Unfortunately, I think it won't be that simple but let's wait for Tamas'
opinion. As I said, he is the C# and SWIG guru here.

Tamas, I'd be thankful if you could share your experience and knowledge
in this area. Perhaps you guys could collaborate in the area of C#
bindings development for GDAL Windows CE port.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list