Static library building

Vindex vindex9 at gmail.com
Mon Mar 19 14:07:52 UTC 2018


'main.d':

import pack.mod;
void main() {
     fn("Hello");
}

'mod.d':

module pack.mod;
void fn(string s) {
     import std.stdio;
     writeln("Hello");
}

Both files are in the same directory.
So all is well:
dmd main.d mod.d

So all is bad:
dmd mod.d -lib
dmd main.d -L-L. -L-l:mod.a

main.d(1): Error: module mod is in file 'pack/mod.d' which cannot 
be read

Please answer why it happens.


More information about the Digitalmars-d-learn mailing list