Reputation: 1136
I've been spending a lot of time trying to build D bindings for an open source C library.
I'm using msvc to build the C a static .lib, but DMD is unable to recognize the .lib file, it seems to be a problem related to the COFF/OMF incompatibilities.
What is the easiest way to compile a C library, OMF compatible, to be linked from D?
Upvotes: 2
Views: 152
Reputation: 48196
Port the header file into a .di
file with matching function signatures and extern (C)
. Then use that as the import
target. You can use the htod tool to help with that.
See http://dlang.org/spec/interfaceToC.html
Upvotes: 1