Various attempts at D bindings for VTK
Steps used to generate SWIG bindings and a test D program using them. It worked once but was hacked upon then I gave up to play with the VTK Wrapper code.
- rdmd genswigi.d -hl=wraplist.txt -po=hdrs -io=ifiles
ls -1 ./third_party/vtk-6.0.0/include/*.h
- rdmd swigit.d -I=./hdrs -o=./bindings ifiles/commoncore.i
- edit commoncore_im.d and change: (this is due to a bug in the D-SWIG generator code)
mixin template SwigOperatorDefinitions() {
...
static if (is(typeof(swigOpEquals(rhs)))) {
return swigOpEquals(rhs);
} else {
...
to
mixin template SwigOperatorDefinitions() {
...
static if (is(typeof(swigOpEquals(rhs)))) {
return cast(bool)(swigOpEquals(rhs));
} else {
...
- cd ifiles
- g++ -fPIC -I../third_party/vtk-6.0.0/include -shared commoncore_wrap.cxx -o ../bindings/libcommoncore_wrap.so
- cd ../bindings
- dmd -lib *.d -L-L../third_party/vtk-6.0.0/lib/linux_x86_64/debug/ -L-lvtkCommonCore-6.0 -L-lvtkCommonSystem-6.0
- cd ../
- dmd test.d bindings/commoncore.a -I./bindings -L-L./bindings -L-ldl -L-lcommoncore_wrap -L-L../third_party/vtk-6.0.0/lib/linux_x86_64/debug -L-lvtkCommonCore-6.0