D语言中国论坛"

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

Ubuntu安装D语言编译器 DMD 及D语言IDE Mono-D

Ubuntu安装D语言编译器 DMD 及D语言IDE Mono-D

1 路径设置:

用云同步软件保存和同步代码,推荐使用Dropbox。 ~/Dropbox/d2/src 保存自己写的代码 ~/Dropbox/d2/samples 示例代码 ~/Dropbox/d2/Mono-D MonoDevelop的D语言插件 /opt/dlibs D语言第三方库源文件目录 /opt/mono IDE MonoDevelop目录

2 Ubuntu 安装 D语言编译器DMD

打开: <http://dlang.org/download.html> 下载: <http://downloads.dlang.org/releases/2014/dmd_2.065.0-0_amd64.deb> 双击文件进行安装 sudo apt-get install ./dmd_2.065.0-0_amd64.deb

查看下安装的路径: $ whereis dmd dmd: /usr/bin/dmd /etc/dmd.conf /usr/bin/X11/dmd /usr/include/dmd /usr/share/dmd /usr/share/man/man1/dmd.1.gz

详细列出安装的文件路径: dpkg -L dmd /usr/bin/rdmd /usr/bin/dmd /usr/bin/dustmite /usr/bin/dumpobj /usr/bin/dman /usr/bin/ddemangle /usr/bin/obj2asm /usr/share /usr/share/dmd /usr/share/dmd/samples/d ... /usr/share/dmd/html/d/ ... /usr/share/man/man5/dmd.conf.5.gz /usr/share/man/man1/obj2asm.1.gz /usr/share/man/man1/dumpobj.1.gz /usr/share/man/man1/rdmd.1.gz /usr/share/man/man1/dmd.1.gz /usr/share/doc/dmd /usr/lib/x86_64-linux-gnu/libphobos2.so.0.65.0 /usr/lib/x86_64-linux-gnu/libphobos2.a /usr/lib/i386-linux-gnu/libphobos2.so.0.65.0 /usr/lib/i386-linux-gnu/libphobos2.a /usr/include/dmd/druntime/import/object.di /usr/include/dmd/druntime/import/core /usr/include/dmd/druntime/import/core/thread.di ... /usr/include/dmd/phobos/std/syserror.d ... /usr/include/dmd/phobos/std/ascii.d ... /usr/include/dmd/phobos/etc/c/sqlite3.d /usr/include/dmd/phobos/etc/c/zlib.d /usr/include/dmd/phobos/etc/c/curl.d /etc/dmd.conf /etc/bash_completion.d /etc/bash_completion.d/dmd /usr/share/doc/dmd/changelog.html /usr/lib/x86_64-linux-gnu/libphobos2.so /usr/lib/x86_64-linux-gnu/libphobos2.so.0.65 /usr/lib/i386-linux-gnu/libphobos2.so /usr/lib/i386-linux-gnu/libphobos2.so.0.65

看看默认的配置文件: cat /etc/dmd.conf [Environment32] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu -L--export-dynamic [Environment64] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic

3 Ubuntu安装Monodevelop

预编译好的monodevelop,下载地址:http://simendsjo.me/files/abothe/ 安装 方法: wget http://simendsjo.me/files/abothe/MonoDevelop.x64.Master.tar.xz sudo tar -xPf MonoDevelop.x64.Master.tar.xz /opt/mono/bin/monodevelop

我运行时,发生错误, gnomeplatform插件不能运行。解决方法是再安装monodevelop-beta PPA

Ubuntu官方的Mono版本是3.2.8,较旧。安装最新版PPA的方法是: sudo add-apt-repository ppa:ermshiperete/monodevelop-beta sudo apt-get update sudo apt-get install monodevelop-current

运行monodevelop sudo /opt/mono/bin/monodevelop

4 Ubuntu安装D语言IDE插件 MonoD

运行MonoDevelop: /opt/mon/bin/monodevelop 打开菜单`Edit, Preference,Projects, .Net Runtimes` 添加 /opt/mono 如果默认没有自动设置好。在写这个文章的时候,正确的应该是: Mono 3.4.1(Default)

Clonse MonoD项目工程到本地: cd ~/Dropbox/d2 git clone https://github.com/aBothe/Mono-D.git cd Mono-D git submodule init git submodule update

4.0.1 构建MonoD

菜单 File, Open, 选择 MonoDevelop.DBinding.sln 菜单`Edit, Build All`,然后: cd /opt/mono/lib/monodevelop/AddIns ln -s -d /home/donald/Dropbox/d2/Mono-D/MonoDevelop.DBinding/bin/Debug D

注意,官方github主页上写的是:`ln s d %YourProjectDirectory%/Mono-D/bin/Debug D` 与实际路径不符,Mono-D/bin目录不存在,应该改成 Mono-D/MonoDevelop.DBinding/bin

打开的MonoDevelop左边,选择 MonoDevelop.D options,然后 Properties, Run, Custom Commands,Execute,Command: 默认是:`/opt/mono/lib/monodevelop/bin/MonoDevelop.exe` 改成:`/opt/mono/bin/monodevelop`

5 用D语言IDE运行 hello.d

把D语言示例文件复制到Dropbox目录: cp /usr/share/dmd/samples/d/* ~/Dropbox/d2/samples/ 运行monodevelop:`sudo optmono/bin/monodevelop` File, Open, 选择 ~/Dropbox/d2/samples/hello.d Ctrl + F5 start without debugging 不出意外的话就成功运行了D2 hello world

5.1 D语言IDE编辑器资源:

I use monoD and it is by far the best IDE for D that I have tried, I have tried to mess with Visual D on 3 different occasions but I have never got it working properly and I didn't want to use eclipse either as it is kinda bloated. Its super simple as well, just get monoDevelop running and download the D plugin from the plugin manager, set your paths and your done.

Mono-D is best of IDE's in my opinion, but it is only viable if you are on bleeding edge distro or fine with manually building latest Mono-Develop version.

5.1.1 Ubuntu安装 Vim:

sudo apt-get install vim

安装Vim发行版 spf13-vim: sudo apt-get install curl curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh Cloning into '/home/donald/.spf13-vim-3'... Cloning into '/home/donald/.vim/bundle/vundle'... © 2014 http://vim.spf13.com/

vim: - https://github.com/spf13/spf13-vim - https://github.com/JesseKPhillips/d.vim - http://www.vim.org/scripts/script.php?script_id=379

- de (delete to end of the word) - ye copies from the cursor to the end of the word - d5e, delete to five word endings - di{ for "delete inside this block - ci" change inside quotes (")

5.1.2 其他D语言编辑器相关信息

https://github.com/BBasile/Coedit

DKit for Sublime Text https://github.com/yazd/DKit

Geany+KDbg Geany is lightweight, supports D syntax, provides tabs, file browsing, projects, built-in command promp, folder search, and regex search and replace. If you want it to build or debug, you can set up some command line statements that you apply to buttons in the toolbar. Note: You need to install an extra plugin to gain project abilities.

https://github.com/DigitalMars/med

5.1.3 参考:

- https://github.com/aBothe/Mono-D - http://mono-d.alexanderbothe.com/ - http://dlang.org/dmd-linux.html - https://launchpad.net/~ermshiperete/+archive/monodevelop

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

D语言中国   Video Software Download   整体观