Getting an access violation before main starts

Kapps via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 10 18:52:47 PDT 2014


The digitalmars.D.learn newsgroup is a more appropriate place for 
this, but as for your issue, one thing to keep in mind is that 
static constructors are run before main:

import std.stdio;

static this() {
	writeln("Foo");
}

void main() {
	writeln("main");
}

$ rdmd test.d
Foo
main


More information about the Digitalmars-d mailing list