`

手工构建和安装Tango和dmd

阅读更多

Manual Build and Install of Tango and DMD

In these instructions, the newest available DMD and Tango will be installed.

以下介绍了最新可用的DMD和Tango的安装方法。

  1. Download DMD.

下载DMD

  • download the latest DMD 1.0 compiler.
  • 下载最近发行的DMD1.0编译器。
  • extract the zip file
  • 解压下载的ZIP文件。
  • create a C:\dmd folder
  • 创建一个C:\dmd 文件夹(也可以在任意你需要安装的文件夹下新建一个叫dmd的文件夹)
  • move windows\bin and windows\lib from the zip file to C:\dmd
  • 把解压开的文件夹下windows目录下的bin 和lib文件夹移到C:\dmd 下(或你新建的dmd文件夹)

2.   Download DMC.

下载DMC

  • extract the zip file
  • 解压ZIP文件。
  • move the containing "dm" directory to C:\
  • 把解压的文件移到C:\ 下(也可以是任意的你希望放置的文件夹)

3. Modify the environment path:

修改环境变量

  • Go to "Control Panel" => "System" => "Advanced" => "Environment Variables"
  • 找到“控制面板”=>“系统”=> “高级”=> “环境变量”(vista下可以右击桌面“计算机”,点击“高级系统设置”,再点“环境变量”,在上边“XX的用户变量”列表里有“path”变量,这就是下一步要修改的,如果没有,就点“新建”新建一个)
  • Look for the "Path" system variable
  • 查找"path"系统变量
  • Add ";C:\dmd\bin;C:\dm\bin" to the value string
  • 添加";C:\dmd\bin;C:\dm\bin" 到字符串值(如果在前面,你把dmd和dmc放到别的文件夹下,如我的“F:\d\dmd.1.043\dmd\windows”和“F:\d\dm”,则相应的把“F:\d\dmd.1.043\dmd\windows\bin”和“F:\d\dm\bin”加到“path"变量值里,目的是让我们可以在任意目录下从命令行调用这两个目录下的可执行文件)
  • Close the windows
  • 点“确定”关闭设置路径所打开的所有窗口
  • Open up the windows console and type "dmd" and "dmc" to check if the programs are available.
  • 打开一个windows控制台键入“dmd”和“dmc"以检测程序是否可用。(在Vista的任意文件夹上按住shift键点鼠标右键就会看到“在此处打开命令窗口”的命令。

4. Get and compile Tango sources.

获取并编译Tango源码。

  • Go to the Tango source browser
  • 来到Tango源码浏览页面
  • click on "Zip Archive" to download the newest Tango sources
  • 点击"Zip Archive"下载最新的Tango源码
  • extract the zip folder and move it to C:\ (to avoid empty spaces in the path)
  • 解压下载的zip文件,
  • open up a Command Line and go in the "lib" directory
  • 打开命令行来到“lib”目录里(打开解压开的文件夹来到“lib”目录里,执行下面框里的三个批处理文件)
  • if you have MSYS installed do "touch lib\compiler\dmd\rt\minit.obj" in the msys console
  • then type and execute:
    .\build-dmd.bat
    .\build-win32.bat
    .\build-tango.bat dmd
    

This will create tango-base-dmd[-d].lib, tango-win32-dmd.lib and tango-user-dmd.lib.

将会得到 tango-base-dmd.lib, tango-base-dmd-d.lib,tango-win32-dmd.lib 和 tango-user-dmd.lib.

 

5. Install Tango

安装Tango 

  • move these three files to C:\dmd\lib
  • create C:\dmd\import\
  • copy the folders "tango", "std" and file "object.di" from the tango trunk to C:\dmd\import\
  • Modify the Environment section of C:\dmd\bin\sc.in to look like this:
[Environment]
LIB="%@P%\..\lib"
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango-base-dmd.lib -debuglib=tango-base-dmd-d.lib -L+tango-user-dmd.lib
LINKCMD=%@P%\link.exe
  1. Testing
  • create a text file called "maid.d":
module main;

import tango.io.Stdout;

void main(char[][] args)
{
  Stdout("Hello World!").newline;
}
  • in a windows console, go to the directory you created main.d and type
dmd main.d
.\main.exe
  • "Hello World!" should be printed on the screen
  • Have fun! :-)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics