How to make .lib file using dmd?

Bradley Smith digitalmars-com at baysmith.com
Thu Nov 9 11:37:41 PST 2006


Tiberiu Gal wrote:
> On Thu, 09 Nov 2006 14:00:10 +0200, clisper <clisper at 163.com> wrote:
> 
>> I want to make some d files to .lib file, what should i do?
> 
> I use build (bud):
> build -lib project\all.d

This assumes that in project/all.d are imports of all the modules. To 
make mylib.a like below, the command is:
   build -lib -Tmylib.a project/all.d

> but you can use dmd:
> dmd -c file1 file2
> lib -c mylib.lib file1.obj file2.obj

The equivalent on Linux is:
   dmd -c file1.d file2.d
   ar cr mylib.lib file1.o file2.o



More information about the Digitalmars-d mailing list