How does the compiler look for the files of imports?

Jakob a at b.com
Tue Sep 18 15:19:46 PDT 2007


I have the following files:

foo/bar.d
	module foo.bar;
	import lol.rofl;

lol/rofl.d
	module lol.rofl;


If i change to the directory where "foo" and "lol" are in, and do
	gdc foo/bar.d lol/rofl.d
it finds all the files.

If i change to the directory "foo/" and do
	gdc bar.d ../lol/rofl
it doesn't compile:
bar.d:3: module rofl cannot read file 'lol/rofl.d'


IMHO, the compiler should notice that the module name is 'foo.bar' (and not only 'bar') and so the directory to search for imports is the parent directory. Or what do you think about that?



More information about the Digitalmars-d mailing list