November 18, 2010 Re: linking custom modules (dmd) | ||||
---|---|---|---|---|
| ||||
On Thursday 18 November 2010 02:34:39 spir wrote:
> Hello,
>
> I haven't found the way to have custom modules linked by dmd like stdlib
> ones. For instance, if program P imports modules M and std.string, I need
> to manually write a build command like: $ dmd -w -ofP P.d M.d
> What have I missed?
_All_ modules and libraries that you want to build/link with your program must be passed to dmd. That means either explicitly listing them or having them listed in the DFLAGS environment variable. dmd.conf sets that variable and includes the druntime and phobos libraries in it. dmd does not go searching for modules or libraries that you don't actually give it.
It would be nice if it were to be smart enough to go looking at all the directories that it's given and grab the appropriate files since the package system clearly delineates where the files are (since packages and folders are in a one-to-one ratio with identical names), but unfortunately, it doesn't work that way. If you want that sort of behavior, you have to use an external tool, and I'm not all that familiar with what they are, since I don't use them, and some of them don't work with D2.
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation