dcodepad

can't get hello, world program to work


I'm trying to get the hello, world program from D (The Programming Language)/d2/Hello, World! to work on codepad.org. Here's my code:

/* This program prints a
   hello world message
   to the console.  */

import std.stdio;

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

Here's the output I get when I run it at http://codepad.org/MdLVQEMm:

Line 9: Error: undefined identifier writeln
Line 9: Error: function expected before (), not writeln of type int

Any ideas as to what I'm doing wrong? I pretty much just copy / pasted the code..


Solution

  • From their about page, codepad.org uses D version 1.026, which was released in 2008. For reference, the current version is 2.074.1.

    It's unlikely that modern D code will work with such an old version of D, especially after a major version bump. You'll have to use a different service with updated tools.