I don't think this can work: alias void function(int) MyHandler; maybe: alias extern(C) void function(int) MyHandler; And there's no need to call it like this: '(*mh)(1)', call it mh(1).