Getting started with D2 on Windows

I grabbed the "dmd D 2.0 compiler for installation of 1 for Windows" from http://www.digitalmars.com/d/download.html , installed and tried to compile hello world example from the "programming language D", 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 has something been incorrectly installed, or ...?

+7
source share
1 answer

Type "dmd" without any arguments and see which version you are using. It seems you are using D1. Perhaps the installer set the path to dmd to the path to dmd2 in your environment. Check the PATH variable.

+9
source

All Articles