---------
// source/foo/bar/quux.c
int twice(int i) { return i * 2; }
// source/mod.d
import foo.bar.quux;
---------
% dmd -c -Isource source/mod.d # fine
% dmd -c -Isource source/mod.d source/foo/bar/quux.c
source/mod.d(1): Error: module `quux` from file source/foo/bar/quux.c must be imported with 'import quux;'
It doesn't help that one can't explicitly declare the module name since quux.c is a C file.
Comment #1 by bugzilla — 2024-02-28T21:27:37Z
The following command will work:
dmd -c -Isource source/mod.d -mv=foo.bar.quux=source/foo/bar/quux.c
and will compile source/mod.d
However, you'll still need to compile quux.c separately with:
dmd -c source/foo/bar/quux.c
Comment #2 by robert.schadek — 2024-12-13T19:33:34Z