www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Any recent success with SWIG?

reply Ryan <ryan a_fake_email.non> writes:
I would like to use a library with a c interface from D (gdal 
actually), but I can't find any bindings. I've looked at htod, 
but I also see that gdal has project maintained SWIG interfaces 
and SWIG claims to work with D (both D1 and D2).

So I installed the latest SWIG, but I haven't been able to get 
the SWIG provided D examples to work. Everything compiles, but 
when I run an example I get an Access Violation, it looks like it 
is trying to use a null pointer somewhere.

Has anyone had success with this? Or maybe has SWIG support for D 
fallen behind?

I'm using windows 10 with MSYS2 as my shell environment to 
support the Autotools build files that came with SWIG, which is 
what they recommend on the website for building the examples.

Thanks,
Oct 19 2016
parent Jacob Carlborg <doob me.com> writes:
On 2016-10-19 18:38, Ryan wrote:
 I would like to use a library with a c interface from D (gdal actually),
 but I can't find any bindings. I've looked at htod, but I also see that
 gdal has project maintained SWIG interfaces and SWIG claims to work with
 D (both D1 and D2).

 So I installed the latest SWIG, but I haven't been able to get the SWIG
 provided D examples to work. Everything compiles, but when I run an
 example I get an Access Violation, it looks like it is trying to use a
 null pointer somewhere.

 Has anyone had success with this? Or maybe has SWIG support for D fallen
 behind?

 I'm using windows 10 with MSYS2 as my shell environment to support the
 Autotools build files that came with SWIG, which is what they recommend
 on the website for building the examples.
Try using DStep [1], it's a tool similar to htod. [1] https://github.com/jacob-carlborg/dstep -- /Jacob Carlborg
Oct 20 2016