Consider this code: =========== import core.sys.posix.dlfcn; extern(C) void fun() {} void main() { fun(); void *hndl = dlopen(null, RTLD_LAZY); if (!hndl) assert(0); auto p = dlsym(hndl, "fun".ptr);
Does auto p = dlsym(hndl, fun.mangleof.ptr); work any better?