Closed andre2007 closed 4 years ago
Whatever is going on, it's not an ld.gold problem, since I exclusively use that linker.
I don't know where ubuntu installs libclang. From my experiences with the Travis Ubuntu container, it seems to be in /usr/local/clang-7.0.0/lib (adjust as necessary for the version number, obviously).
For docker image dlang2/ldc-ubuntu
the path is actually /usr/lib/clang/6.0.0
.
I tried to create a symbolic link to check whether the error disappear
ln -s /usr/lib/clang/6.0.0 /usr/local/clang-6.0.0
but still, the same error while trying to build dpp.
I had a similar problem in Gentoo (ld cannot find -lclang) and for some reason (bug?) dub doesn't pass DFLAGS to dmd in the linking phase, however it will pass it if you are using --compiler=ldc2
.
So I've resorted to setting the CC env. variable.
The following commands worked in my case:
CC=clang dub build
// clang auto detects the library
CC="gcc -L/usr/lib/llvm/9/lib64/" dub build
DFLAGS="-L=-L/usr/lib/llvm/9/lib64/" dub build --compiler=ldc2
// with the ldc2 switch DFLAGS works
@BorisCarvajal thank you very much.
I tried to install dpp within a dockerfile, but it fails with:
the dockerfile looks like this:
In the readme I can only find the package dependency
libclang-6.0-dev
. What else do I miss?