prolog and epilog code

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 2 10:23:57 PDT 2016


On Tuesday, 2 August 2016 at 17:04:08 UTC, Rufus Smith wrote:
> It doesn't seem to be that easy!

_d_run_main is extern(C), not just extern. Then your code should 
work.

You can also simplify more:

---
import std.stdio;
import core.runtime;

extern(C) int main() {
	rt_init();
	writeln("Hello from D");
	rt_term();
	return 0;
}
---



More information about the Digitalmars-d-learn mailing list