This tutorial is currently available for Windows with DMD compiler and SkyOS with GDC.
Downloading and installing the DMD compiler under Windows
To do: a full section with an installation guide
First you have to download the latest version of the D compiler from http://www.digitalmars.com//d/dcompiler.html#Win32 - download the dmd.zip and dmc.zip files. DMD uses the DMC linker and make tool for building.
Unpack the dmd.zip file to a temporary directory. It contains two folders: "dm" and "dmd". I don't really know why there are two directories - imo you can safely delete the dm directory because it only contains files that we're going to extract from dmc.zip.
Extract the files dm/bin/link.exe from the dmc.zip to dmd/bin/link.exe, extract the dm/lib/snn.lib to dmd/lib/snn.lib.
For windows you will need to copy all the *.lib files from dm\lib\ to dmd\lib\ if using the sc.ini file config below
The dmd/bin/sc.ini file contains some settings for the DMD compiler, among others the path to the link.exe. Edit it with you favourite text editor from:
[Version]
version=7.51 Build 020
[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\src\phobos"
LINKCMD=%@P%\..\..\dm\bin\link.exe |
to
[Version]
version=7.51 Build 020
[Environment]
LIB="%@P%\..\lib"
DFLAGS="-I%@P%\..\src\phobos"
LINKCMD=%@P%\link.exe |
so the compiler knows where to find your extracted "link.exe".
Now you're done, you can move the dmd directory anywhere you want to, perhaps you would want to move it to your programs directory and rename it to "Digital Mars D compiler" or anything. If you want to easily access the dmd compiler, set the Windows path to the bin directory:
To Do: Verify this on an english Windows (98/ME/2000/XP and so on) because i only have german Windows XP
Right-click on "My computer", click on Properties, go to the advanced tab, click the "Enviroment Variables" button. Select your "Path" Variable in the list box, click on edit. Add a semicolon when it's not already there, then add the Path to the bin directory (for example: "...;C:\Program Files\DMD\bin"). Quit all the dialog boxed with a click on "OK".
Now you should be able to run dmd.exe in your command shell:
- Open the command shell: Start->Run, enter cmd (command on Windows 95/98/ME) and press enter
- Enter "dmd" and press enter
- -> You should see the following:
Digital Mars D Compiler v0.110
Copyright (c) 1999-2004 by Digital Mars written by Walter Bright
Documentation: www.digitalmars.com/d/index.html
Usage:
dmd files.d ... { -switch }
files.d D source files
-c do not link
-d allow deprecated features
-g add symbolic debug info
-gt add trace profiling hooks
-v verbose
-O optimize
-odobjdir write object files to directory objdir
-offilename name output file to filename
-op do not strip paths from source file
-Ipath where to look for imports
-Llinkerflag pass linkerflag to link
-debug compile in debug code
-debug=level compile in debug code <= level
-debug=ident compile in debug code identified by ident
-inline do function inlining
-release compile release version
-unittest compile in unit tests
-version=level compile in version code >= level
-version=ident compile in version code identified by ident |
Downloading and installing the GDC compiler under SkyOS
The first you have to do is downloading the GDC. It calls "Unstable SkyOS package" at this time. But works good!
The most difficult would be done:)
By default, Firefox save it under your home folder e.g. "boot/home/admin/".
Go to your home folder and simple click on the gdc.pkg. The Package file will do the rest.
Now you should be able to run gdc in your bash:
- Open your bash.
- Type cd /boot/programs/gdc/bin.
- Call ./gdc Usage.
Now your D compiler is ready!
|