www.digitalmars.com         C & C++   DMDScript  

D - Creating library files

reply "Charles Sanders" <sanders-consulting comcast.net> writes:
Sorry couldnt find any info on how to do this, How do i create a library
file for linking with D programs ?

Charles
Jul 29 2003
next sibling parent Helmut Leitner <helmut.leitner chello.at> writes:
Charles Sanders wrote:
 
 Sorry couldnt find any info on how to do this, How do i create a library
 file for linking with D programs ?

I think you can use any standard library utility. But I like Burtons digc for its simplicity, e. g. c:\dmd\bin\digc -Ic:\dmd\src\phobos -Ic:\d -lib=venus *.d No need to maintain a makefile on adding modules... -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jul 28 2003
prev sibling next sibling parent reply Burton Radons <loth users.sourceforge.net> writes:
Charles Sanders wrote:
 Sorry couldnt find any info on how to do this, How do i create a library
 file for linking with D programs ?

digc allows this if you add "-lib=name" to the command-line. Its process is: - Search code for import statements and include and expand libraries as necessary. - Execute "dmd -c FILES" - Execute "lib -p32 -c LIBRARY_NAME OBJECT_FILES" - Append import information to the library file. I can look up the formats involved with this if you're planning on incorporating digc functionality into DIDE. - If -install is provided in the command-line, move the file to the dmd/lib directory. If you're building a dll, it's more involved, although you just need to add "-shared" to the digc command-line. It involves scanning object files for export symbols and generating def files.
Jul 28 2003
next sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
Ok great I'll use digc for creating libraries, in fact I'm thinking I'll use
it for every compilation option is alright that I bundle dig with dide ?

 - Append import information to the library file.  I can look up the
 formats involved with this if you're planning on incorporating digc
 functionality into DIDE.

Yea I'd like to make a library and dll project option. Charles "Burton Radons" <loth users.sourceforge.net> wrote in message news:bg507a$qbp$1 digitaldaemon.com...
 Charles Sanders wrote:
 Sorry couldnt find any info on how to do this, How do i create a library
 file for linking with D programs ?

digc allows this if you add "-lib=name" to the command-line. Its process is: - Search code for import statements and include and expand libraries as necessary. - Execute "dmd -c FILES" - Execute "lib -p32 -c LIBRARY_NAME OBJECT_FILES" - Append import information to the library file. I can look up the formats involved with this if you're planning on incorporating digc functionality into DIDE. - If -install is provided in the command-line, move the file to the dmd/lib directory. If you're building a dll, it's more involved, although you just need to add "-shared" to the digc command-line. It involves scanning object files for export symbols and generating def files.

Jul 29 2003
parent Burton Radons <loth users.sourceforge.net> writes:
Charles Sanders wrote:

 Ok great I'll use digc for creating libraries, in fact I'm thinking I'll use
 it for every compilation option is alright that I bundle dig with dide ?

It's public domain; you can do whatever you want with it. I am explicitly fine with it, yeah.
Jul 29 2003
prev sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
Hmm Im having a little trouble creating a library file, given the file

foo.d : class Foo { this() {} }

digc -lib=foo foo.d

Im getting :

Error: file 'foo.lib' not found

I am also having trouble creating libraries with straight lib.exe which I
just realized, does it depenend on some envrionmental variables or something
(lib.exe i mean) ? , sc.ini looks correct.

Charles

"Burton Radons" <loth users.sourceforge.net> wrote in message
news:bg507a$qbp$1 digitaldaemon.com...
 Charles Sanders wrote:
 Sorry couldnt find any info on how to do this, How do i create a library
 file for linking with D programs ?

digc allows this if you add "-lib=name" to the command-line. Its process is: - Search code for import statements and include and expand libraries as necessary. - Execute "dmd -c FILES" - Execute "lib -p32 -c LIBRARY_NAME OBJECT_FILES" - Append import information to the library file. I can look up the formats involved with this if you're planning on incorporating digc functionality into DIDE. - If -install is provided in the command-line, move the file to the dmd/lib directory. If you're building a dll, it's more involved, although you just need to add "-shared" to the digc command-line. It involves scanning object files for export symbols and generating def files.

Jul 30 2003
parent "Charles Sanders" <sanders-consulting comcast.net> writes:
Hmm i re-downloaded DM and it works fine.

Charles

"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bg7p8m$f5c$1 digitaldaemon.com...
 Hmm Im having a little trouble creating a library file, given the file

 foo.d : class Foo { this() {} }

 digc -lib=foo foo.d

 Im getting :

 Error: file 'foo.lib' not found

 I am also having trouble creating libraries with straight lib.exe which I
 just realized, does it depenend on some envrionmental variables or

 (lib.exe i mean) ? , sc.ini looks correct.

 Charles

 "Burton Radons" <loth users.sourceforge.net> wrote in message
 news:bg507a$qbp$1 digitaldaemon.com...
 Charles Sanders wrote:
 Sorry couldnt find any info on how to do this, How do i create a



 file for linking with D programs ?

digc allows this if you add "-lib=name" to the command-line. Its process is: - Search code for import statements and include and expand libraries as necessary. - Execute "dmd -c FILES" - Execute "lib -p32 -c LIBRARY_NAME OBJECT_FILES" - Append import information to the library file. I can look up the formats involved with this if you're planning on incorporating digc functionality into DIDE. - If -install is provided in the command-line, move the file to the dmd/lib directory. If you're building a dll, it's more involved, although you just need to add "-shared" to the digc command-line. It involves scanning object files for export symbols and generating def files.


Jul 30 2003
prev sibling parent Dario <Dario_member pathlink.com> writes:
Charles Sanders:
Sorry couldnt find any info on how to do this, How do i create a library
file for linking with D programs ?

In Windows type: lib -c a.lib b.obj c.obj d.obj ... to create a library dmd a.d b.obj c.lib ... to use it See http://www.digitalmars.com/ctg/lib.html for documentation and more examples.
Jul 29 2003