Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started with D2 on Windows

Tags:

d

I grabbed the "dmd D 2.0 compiler 1-click install for Windows" from http://www.digitalmars.com/d/download.html, installed, and tried to compile the hello world example from "The D Programming Language", i.e.

import std.stdio;

void main() {
    writeln("Hello, world!");
}

with "dmd hello.d", but was met with:

hello.d(4): Error: undefined identifier writeln, did you mean function writefln?
hello.d(4): Error: function expected before (), not __error of type _error_

Is the book out of date, or did something install incorrectly, or...?

like image 383
xode Avatar asked Jul 31 '11 21:07

xode


People also ask

Can you play D2 on PC?

Destiny 2 is now available on the Microsoft Store and Xbox app for PC!


1 Answers

Type 'dmd' without any arguments and see what version you're running. You seem to be using D1. The installer probably placed the path to dmd before the path to dmd2 in your environment. Check your PATH variable.

like image 72
fwend Avatar answered Nov 04 '22 20:11

fwend