$> dmd Special/special.d Common/common.o Special/special.d(4): Error: module common is in file 'common.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import

This is not a linker error. It's a compiler error. You need common.d for the import, so the compiler can know which symbols are available. For any modules you import, you need either the original source file (.d) or a D interface (header) file (.di) which contains the type & function declarations and any template implementations you need.

That worked. With "dmd -c -Hd=Common Common/common.d" I created a common.di file then I removed the common.d and could compile with "dmd -ICommon Special/special.d Common/common.o". With this, common.d does not need to be recompiled a lot of times if there are several special.d-files. Thank you!


Reply via email to