Linking to libraries with D

Jarrod gigantic.midget at gmail.com
Fri Nov 16 05:33:17 PST 2007


== Quote from torhu
> Lets assume that main.d imports tools.d.  When the compiler compiles
> main.d, it uses tools.d just as a header, to see that the correct
> declarations are there.  But unless you put it on the compiler's command
> line, tools.d itself won't actually be compiled and linked.
So I thought. This is a tad disappointing, as I was hoping I could use the import
system as a means of actually including the code itself. I guess its not a huge
setback but it does sure feel a bit 'broken' to implement such a system. It would
seem more intuitive to have the imported modules.. well, imported, instead of just
used as a header.

> You can use the bud tool from dsource.org/projects/build to automate
> this.  Then you only need to include the main source file, plus
> libraries to get the same effect:
> bud main.d stuff.lib
> There's also a similar tool called dsss that linux users seem to prefer:
> http://www.dsource.org/projects/dsss
I have dsss, but I wasn't aware that it could be used to automate this process.
Alexanders reply also suggested dsss, so I guess I'll look into its usage.

Thanks to you both for the quick reply,
Jarrod.



More information about the Digitalmars-d mailing list