How to get dub to work when I have dlang installed in custom directory?

Jamal via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 3 12:35:04 PST 2017


I have successfully compiled and installed dmd, druntime and 
phobos and installed them all in
     /opt/dlang/dmd
     /opt/dlang/druntime
     /opt/dlang/phobos

Everything works, I can compile and run d programs just fine. I 
use this in my .bashrc to make everything work:
     # Dlang
     export PATH="/opt/dlang/dmd/src:$PATH"
     export 
PATH="/opt/dlang/druntime/generated/linux/release/64:$PATH"
     export PATH="/opt/dlang/druntime/import/:$PATH"
     export 
PATH="/opt/dlang/phobos/generated/linux/release/64:$PATH"
     export 
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/dlang/phobos/generated/linux/release/64
     dlang_compile="-fPIC -L-lphobos2 -I/opt/dlang/druntime/import 
-I/opt/dlang/phobos 
-L-L/opt/dlang/phobos/generated/linux/release/64"
     alias dmd="dmd $dlang_compile"

I installed dub and added the binary to my path. I can use dub 
init to create a new project, but when I run dub in a initiated 
project I get this message:
     Failed to invoke the compiler dmd to determine the build 
platform: Error: cannot find source code for runtime library file 
'object.d'
        dmd might not be correctly installed. Run 'dmd -man' for 
installation instructions.
        config file: (null)
     Specify path to file 'object.d' with -I switch

I have no idea what is is wrong and or how to fix it.

Any help?


More information about the Digitalmars-d-learn mailing list