We should make a mixin template DllMain that has a generic main. import std.dll; void myDllProc() { } mixin DllMain!myDllProc; I did this with my cgi.d and like it alot - the templated main saves a lot of boilerplate.