Hi there,
I'm currently trying to set up a small demo project using the
Leap Motion API in D. I've run SWIG with -d -d2, and created the
intermediate C++ DLL along with a pair of .d files, leap.d and
leap_im.d. I'm new to D, but very interested and I'd like to set
this up in an idiomatic way & be able to share it, but I'm
running into a problem: When I create a simple sample project
with Visual D and import the Leap module, I get a number of
linker errors:
Error 42: Symbol Undefined
_D4Leap10Controller6__ctorMFZC4Leap10Controller (Leap.Controller
Leap.Controller.__ctor())
Error 42: Symbol Undefined _D4Leap10Controller7__ClassZ
Error 42: Symbol Undefined _D4Leap12__ModuleInfoZ
I've discovered that if I run dmd manually and link in the object
files for leap.d and leap_im.d, these problems go away, and if I
create a separate project to build a .lib and then link to that
it also solves the issue. Both of these options seem hacky to me
though, and I'm wondering if there's some 3rd option I'm missing
- the files contain the entire definitions, so why would it be
necessary to link to them AND specify them as imports? What am I
missing here?