www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Static/dynamic dlls

reply Karl <havenomemailyet domain.com> writes:
I can't understand the difference between a static and a dynamic dll.

A little help please hehe.
Jul 27 2007
next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
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
Jul 27 2007
parent novice2 <sorry noem.ail> writes:
 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.
Jul 27 2007
prev sibling next sibling parent Karl <havenomemailyet domain.com> writes:
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?
Jul 30 2007
prev sibling parent reply Karl <havenomemailyet domain.com> writes:
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?
Jul 30 2007
parent reply Karl <havenomemailyet domain.com> writes:
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?

Jul 30 2007
parent Neal Alexander <wqeqweuqy hotmail.com> writes:
Karl wrote:
 Karl Wrote:
 
 Karl Wrote:

 I can't understand the difference between a static and a dynamic dll.

 A little help please hehe.

Have somebody get it to work this way?


http://www.digitalmars.com/ctg/implib.html
Aug 01 2007