How does the compiler look for the files of imports?

Jakob a at b.com
Thu Sep 20 04:46:01 PDT 2007


Derek Parnell schrieb:
> Are you saying that the compiler should always treat the parent of the
> current directory as a search root?
> 
> One simple workaround is to add "-I.." to the compiler configuration file. 
> 
> I have this in my default bud.cfg file, for example.
> 

I mean, the compiler should make the search-root fitting with the module-names-root.

E.g.:
You have the file "./dir/foo/bar.d", but in this file, the module-name is specified as "foo.bar".
In this case the compiler should search in "./dir/"

If the current directory is changed to "./dir/foo/", so that the file is "bar.d" and the module is "foo.bar", the compiler should search in "../".

The module name must fit to the filename!
Otherwise, imports aren't found.



More information about the Digitalmars-d mailing list