D语言中国论坛"

Login
Register
/ d2 dmd dub dwt vibe-d vibenews
Categories Thread list

Ubuntu安装D语言包管理器DUB

Ubuntu安装D语言包管理器DUB

使用dub可以一键自动下载安装相关依赖库,比较方便。

1 安装dub

sudo wget http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list sudo apt-get update && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && sudo apt-get update sudo apt-get install dub

从源码安装dub的方法: git clone github.com/D-Programming-Language/dub/dub.git cd dub ./build.sh Running dmd... /usr/bin/ld: cannot find -lcurl

出现错误,找不到curl库。先看下curl库应该在什么位置: ld -lcurl --verbose attempt to open /usr/x86_64-linux-gnu/lib64/libcurl.so failed attempt to open /usr/x86_64-linux-gnu/lib64/libcurl.a failed attempt to open //usr/local/lib/x86_64-linux-gnu/libcurl.so failed attempt to open //usr/local/lib/x86_64-linux-gnu/libcurl.a failed attempt to open //usr/local/lib64/libcurl.so failed attempt to open //usr/local/lib64/libcurl.a failed attempt to open //lib/x86_64-linux-gnu/libcurl.so failed attempt to open //lib/x86_64-linux-gnu/libcurl.a failed attempt to open //lib64/libcurl.so failed attempt to open //lib64/libcurl.a failed attempt to open //usr/lib/x86_64-linux-gnu/libcurl.so failed attempt to open //usr/lib/x86_64-linux-gnu/libcurl.a failed attempt to open //usr/lib64/libcurl.so failed attempt to open //usr/lib64/libcurl.a failed attempt to open //usr/local/lib/libcurl.so failed attempt to open //usr/local/lib/libcurl.a failed attempt to open //lib/libcurl.so failed attempt to open //lib/libcurl.a failed attempt to open //usr/lib/libcurl.so failed attempt to open //usr/lib/libcurl.a failed

再找下本机中有没有curl库: $find . -name libcurl* /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3 /usr/lib/x86_64-linux-gnu/libcurl.so.3 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0 /usr/lib/x86_64-linux-gnu/libcurl.so.4 /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0

找到了就好办了,做个软链接就行了: $sudo ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4 /usr/lib/x86_64-linux-gnu/libcurl.so $./build.sh DUB has been built as bin/dub. You may want to run sudo ln -s /opt/dlibs/dub/bin/dub /usr/local/bin sudo cp bin/dub /usr/bin/

1.0.1 参考:

- https://github.com/D-Programming-Language/dub/ - http://d-apt.sourceforge.net/

AsmBB v2.4 (check-in: 5e732b3401545cd1);

D语言中国   Video Software Download   整体观