Few helpful links (some information may be outdated):
- http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/
- http://www.swig.org/Doc2.0/D.html
- http://www.swig.org/tutorial.html
I have never used SWIG personally but my guess based on general knowledge about SWIG:
- Leap_wrap.cxx is C++ source file that wraps calls to C++ functions from target library in extern(C) calls
- Leap_wrap.h is header file with all extern(C) wrappers listed
- Leap_im.d is D module based on Leap_wrap.h with same extern(C) function listed
- Leap.d is D module that uses Leap_im.d as an implementation and reproduces API similar to original C++ one.
So in your D code you want to import Leap.d module. Than compile Leap_wrap.cxx to an object file with your C++ compiler and provide D object files, Leap_wrap.o and target library at linking stage. That should do the trick.
P.S. Leap.cpp source should not be needed. All stuff links directly from Leap_wrap.cxx to target library binary.