On 11/14/2010 00:09, Walter Bright wrote: > I suspect that trying to guess what modules should be added to the > linker list may cause far more confusion than enlightenment when it goes > awry. Currently, a lot of people seem to regard what a linker does as > magic. Making it more magical won't help.
It seems completely straightforward to me. If module A imports module B, then module A depends on module B, therefore compiling and linking module A should also cause module B to be compiled and linked. Apply recursively. The only part of this that is remotely difficult - mapping module names to files on the disk - is already done by the compiler. This would only happen when compiling and linking as a single step, which would be the preferred way to invoke DMD. When linking as a separate step, all object files would still need to be individually passed to the linker. -- Rainer Deyke - rain...@eldwood.com