DLL's and D

Chris Pons cmpons at gmail.com
Thu Mar 15 13:16:45 PDT 2012


Ok, I've actually run into another problem. I've decided to use a 
static library, since my project is small. I have added the path 
to the static library's .lib file in my project properties, just 
like with derelict2. However, I'm not sure how to use import 
properly.

The library in question is in location (relative to my project) 
Libraries/Math/math.lib.

If a module in math.lib is matrix, i've tried import declarations 
like:

import Libraries.Math.math.matrix; //probably very wrong
import math.matrix;
import matrix;

I tried to look at derelict2 for an example, and the VisualD 
project file there, since it created .lib files. The VS 2010 
solution file was in project/visuald/DerelictSDL(etc), and each 
project refernces modules in Derelict2\DerelictSDL\derelict\sdl\ 
(for example). So it makes sense that the import would be import 
derelict.sdl.sdl to import sdl.d.

This just lead me to believe that import matrix or import 
math.matrix should work.

Am I wrong in assuming that the library contains the D code I 
need to use? So I would not be trying to import the .d file I 
used to construct the static library?





More information about the Digitalmars-d-learn mailing list