www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do I create a static link library?

reply Cris <central_p hotmail.com> writes:
How do I create a static link library? I've seen instructions how to do 
it with DMD but I cannot find them now.

I have 20+ modules interfacing to a .dll and I have to include all of 
them, when compiling or I get link errors.
So I want to be able just to import the modules without to include all 
source code in a project.
Feb 23 2006
parent jcc7 <jcc7_member pathlink.com> writes:
In article <dtlcei$1l4e$1 digitaldaemon.com>, Cris says...
How do I create a static link library? I've seen instructions how to do 
it with DMD but I cannot find them now.

I have 20+ modules interfacing to a .dll and I have to include all of 
them, when compiling or I get link errors.
So I want to be able just to import the modules without to include all 
source code in a project.

If want to create a .lib file, that's pretty easy. If you want to create a .dll, I can't help you. Someone else probably can, but .dll's aren't my thing. :( First compile your D files to produce .obj files: dmd -c winnt.d ole2.d oleauto.d api.d windef.d commctrl.d -I.. Then use "lib" (http://www.digitalmars.com/ctg/lib.html) to create a .lib file: lib -c win32.lib winnt.obj ole2.obj oleauto.obj api.obj windef.obj commctrl.obj Finally, you can compile an .exe: dmd myprogram.d win32.lib jcc7
Feb 27 2006