www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How to make .lib file using dmd?

reply clisper <clisper 163.com> writes:
I want to make some d files to .lib file, what should i do?
Nov 09 2006
next sibling parent Bill Baxter <wbaxter gmail.com> writes:
clisper wrote:
 I want to make some d files to .lib file, what should i do?

Just a guess, but maybe use the -c "do not link" flag? --bb
Nov 09 2006
prev sibling next sibling parent reply "Tiberiu Gal" <galtiberiu gmail.com> writes:
On Thu, 09 Nov 2006 14:00:10 +0200, clisper <clisper 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 but you can use dmd: dmd -c file1 file2 lib -c mylib.lib file1.obj file2.obj -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 09 2006
parent Bradley Smith <digitalmars-com baysmith.com> writes:
Tiberiu Gal wrote:
 On Thu, 09 Nov 2006 14:00:10 +0200, clisper <clisper 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
Nov 09 2006
prev sibling next sibling parent Walter Bright <newshound digitalmars.com> writes:
clisper wrote:
 I want to make some d files to .lib file, what should i do?

The librarian program turns .obj files into .lib files: http://www.digitalmars.com/ctg/lib.html
Nov 09 2006
prev sibling parent David Medlock <noone nowhere.com> writes:
clisper wrote:
 I want to make some d files to .lib file, what should i do?

If anyone wants it I can send them DManager, a gui project manager I wrote a while back. Its on dsource, but is archived I think. With it you simply: 1. Create a project. 2. Add all D and OBJ files. 3. Right click project name, select Build LIB -DavidM
Nov 10 2006