Try to compile with either ldc or gdc and the -g flag, it
should give you a backtrace. dmd seems to not like linux wrt
backtraces.
...I haven't had any success in compiling with anything but
dub. gdc, dmd, rdmd always give me "module mylib is in file
'mylib.d' which cannot be read" on my "import mylib;"
statement. ...
in dmd you have to pass
- the .lib/.a files a source
- the path to the lib source with '-I'. Sometimes when the
path is not well indicated you get the error you talk about.
This is because the '-I' path must follow carefully the
structure of the lib, e.g
'import myLib.package.moduleThis':
the '-I' must point to the folder that contains the folder
'myLib'.
...
dmd -I+/home/charles/projects/d/mylib/source/mylib/ myprog.d
/home/charles/projects/d/mylib/build/libmylib.a
Same result.
myprog.d(4) Error: module mylib is in file 'mylib.d' which
cannot be read
Statement in myprog is:
import mylib;
...
I used -v to imitate what dub is doing and that works, except
that I don't see any reference to the compiled library itself.
Apparently it is recompiling the library as well, which defeats
the main purpose of having a library in the first place.
And gdc doesn't seem to recognize std.experimental.logger which
is what I used in converting all my debugging code. Sigh.