Thread overview
Creating library files
Jul 29, 2003
Charles Sanders
Jul 29, 2003
Helmut Leitner
Jul 29, 2003
Burton Radons
Jul 29, 2003
Charles Sanders
Jul 29, 2003
Burton Radons
Jul 30, 2003
Charles Sanders
Jul 30, 2003
Charles Sanders
Jul 29, 2003
Dario
July 29, 2003
Sorry couldnt find any info on how to do this, How do i create a library file for linking with D programs ?

Charles


July 29, 2003

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
July 29, 2003
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.

July 29, 2003
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.
>


July 29, 2003
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.


July 29, 2003
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.

July 30, 2003
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.
>


July 30, 2003
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
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.
> >
>
>