Passing directory as compiler argument not finding file

Tony tonytdominguez at aol.com
Fri Apr 13 13:39:23 UTC 2018


On Friday, 13 April 2018 at 12:46:32 UTC, Cym13 wrote:
> On Friday, 13 April 2018 at 01:27:06 UTC, Tony wrote:
>> I think that the typical model (at least in other languages) 
>> is to only compile one D source file at a time. Compile the 
>> b.d file with the -c option to create an object file. Then put 
>> the object file in a library file (either static (easier) or 
>> dynamic). Then you can use the -L compiler option to specify 
>> the directory of the library and the -l  compiler option to 
>> specify the library (library name is shortened - libb.a 
>> referenced as -lb).
>
> Regardless of whether that would work or not this is the 
> opposite of what's recommended in D. D compilers expect you to 
> compile everything at once, or at least by module. That's where 
> it works best when it comes to optimizations etc.

What does "or at least by module" mean? Is it possible to have a 
module that is made up of more than one source file?

What information does a D compiler get when you stick a.d and b.d 
on the command line that it doesn't get if you compile a.d and 
import b.d ?


More information about the Digitalmars-d-learn mailing list