Thread overview
Static/dynamic dlls
Jul 28, 2007
Karl
Jul 28, 2007
Daniel Keep
Jul 28, 2007
novice2
Jul 31, 2007
Karl
Jul 31, 2007
Karl
Jul 31, 2007
Karl
Aug 01, 2007
Neal Alexander
July 28, 2007
I can't understand the difference between a static and a dynamic dll.

A little help please hehe.
July 28, 2007
Karl wrote:
> I can't understand the difference between a static and a dynamic dll.
> 
> A little help please hehe.

I don't think there's any such thing as "static dll"s and "dynamic dll"s.  I think you have your terminology mixed up.

A "static library" is a bundle of code and data, and so is a "dynamic link library" (which are commonly called "DLLs").  The difference is that a static library is designed to be linked into a program at compile time, and a DLL is designed to be linked into a program at run time.

Static libraries are generally .lib files, whilst DLLs are .dll files.

The only other thing to be careful of is that there are various kinds of .lib files, not all of which are compatible with each other.  For instance, DigitalMars' linker doesn't work with .lib files compiled for current versions of Visual C++.  DLLs, on the other hand, tend to work fine once you're got an interface for them.

Hope that helps.

	-- Daniel
July 28, 2007
> I don't think there's any such thing as "static dll"s and "dynamic dll"s.  I think you have your terminology mixed up.

imho, sometimes this terms used (may be not correctly?) to distinguish dll loading method.

"static dll" sometimes means "compiler-handle dll loading". in this case you just say to compiler, that you want to use exterlanl function in some dll. then compiler generate exe such manner, that OS or helper code must load needed dll while exe starting. in windows it create import section in exe file, so windows must load dll or generate error else.

"dynamic dll" sometimes means "programmer-handle dll loading". in this case programmer write own code to find and load need dll and unload it if it not needed. in windows it can be done with LoadLibrary() api function.

i am repeat, that i can mistake and termynology misunderstanding.
July 31, 2007
Karl Wrote:

> I can't understand the difference between a static and a dynamic dll.
> 
> A little help please hehe.

I've been trying to statically link a d program with a dll that calls d code (http://www.digitalmars.com/d/dll.html) and i can't get it to work. I tried the example that comes with the compiler and works fine but it looks like it doesn't work with namespaces. For example replace the module namespace in the example from mydll to mydll.example.

Have somebody get it to work this way?
July 31, 2007
Karl Wrote:

> I can't understand the difference between a static and a dynamic dll.
> 
> A little help please hehe.

I've been trying to statically link a d program with a dll that calls d code (http://www.digitalmars.com/d/dll.html) and i can't get it to work. I tried the example that comes with the compiler and works fine but it looks like it doesn't work with namespaces. For example replace the module namespace in the example from mydll to mydll.example.

Have somebody get it to work this way?
July 31, 2007
Karl Wrote:

> Karl Wrote:
> 
> > I can't understand the difference between a static and a dynamic dll.
> > 
> > A little help please hehe.
> 
> I've been trying to statically link a d program with a dll that calls d code (http://www.digitalmars.com/d/dll.html) and i can't get it to work. I tried the example that comes with the compiler and works fine but it looks like it doesn't work with namespaces. For example replace the module namespace in the example from mydll to mydll.example.
> 
> Have somebody get it to work this way?
I've got one more question related to this. I must import something in my program to access the dll, what should i import? the entire module's namespace? ie: mydll.example. or the name of the dll. I'm having a bit trouble here.
August 01, 2007
Karl wrote:
> Karl Wrote:
> 
>> Karl Wrote:
>>
>>> I can't understand the difference between a static and a dynamic dll.
>>>
>>> A little help please hehe.
>> I've been trying to statically link a d program with a dll that calls d code (http://www.digitalmars.com/d/dll.html) and i can't get it to work. I tried the example that comes with the compiler and works fine but it looks like it doesn't work with namespaces. For example replace the module namespace in the example from mydll to mydll.example.
>>
>> Have somebody get it to work this way?
> I've got one more question related to this. I must import something in my program to access the dll, what should i import? the entire module's namespace? ie: mydll.example. or the name of the dll. I'm having a bit trouble here.

http://www.digitalmars.com/ctg/implib.html