Make your own free website on

MKoD - D Programming Language

Compiling your first D program using the command-line.

Basic Newbie Stuff Compiling your first D program

• Note: You should have first installed the D compiler, and then added the
D compiler's path onto Windows environment variable path before doing
these steps.

If not, return to the "Main" page for this website and follow the sequence
of numbers in the left-hand side of the menu under the "D Info & Setup" section.

  1. Click on the [Start] menu button (normally it's green),
    and from there click on the [Run...] menu item.

    XP's Start Menu, Run Selected

  2. Click on the [Open:] combo-box and type in "cmd" (this is the command-line
    processor Windows), then click on the [Ok] button.

    XP's Run Dialogbox

  3. Now with the command-line window open (if you'd like to change to full screen
    and or back, just use the [Alt][Enter] key combo to switch back and fro),

    XP's CommandLine

  4. Type cd\ (which will move us to the current drive's root directory) and
    press [Enter] key, then type in cd dmd\samples\d\ (this will move us into
    D's samples program directory) and again press [Enter] key, now to compile
    hello.d program, type dmd hello.d and another [Enter] key. If no error
    displayed after compiling, run the program by typing in hello and press the [Enter] key.

    Compile your first D program

  5. From here you can compile other sample program, or you can simply exit
    by typing in exit and then the [Enter] key.
Mars: fourth Rock from the Sun.