Imports and Subfolders and Links (Oh, My!)

Adam D. Ruppe destructionator at gmail.com
Fri Dec 7 16:43:02 UTC 2018


On Friday, 7 December 2018 at 16:39:34 UTC, Ron Tarrant wrote:
> import subfolder.ModuleName;
>
> And in the module files, the first statement is:
>
> module ModuleName;

That's wrong: the import name and the module name should always 
match, in full, including all the dot parts.

So if you "import app.modulename;", the other file must have 
"module app.modulename;"

> dmd -m64 -Lgtkd.lib main.d

Moreover, you should either 1) list all modules in your 
application not in a library on the command line, or 2) if using 
the newest compiler versions, pass the -i flag so the compiler 
will automatically include them for you.



More information about the Digitalmars-d-learn mailing list