DLL's and D

Chris Pons cmpons at gmail.com
Wed Mar 14 20:26:50 PDT 2012


I haven't used DLL's much, especially one I've built on my own, 
so guidance would be appreciated.

I'm trying to figure out how to build a DLL which was written in 
D but i'm not sure i'm doing this right.

I'm using VS2010 and Visual D. Visual D has a template for Dll's 
in D, so I used that to create a new project.

The DLL compiles just fine, but i'm having trouble even getting 
import to work with it. I was following the How-To on this page, 
http://dlang.org/dll.html#Dcode , but I can't even get import to 
work.

With import, is that supposed to reference the name of the DLL? 
So if I had one named math.dll, I would write import math.dll?

Right now i'm getting an error, "Error: module test is in file 
test.d which cannot be read".

Also, what exactly is different between the dynamic load and 
static link in the link above?

Would I need to load the DLL for every module that imports it?

Do I need to use the export keyword for every class/function/etc 
that is meant to be used outside of the DLL?

Also, the DLL i'm trying to make, has several modules, can I 
import a specific module from the dll? Like, import math.calculus 
if calculus was a module in the math DLL?




More information about the Digitalmars-d-learn mailing list