Equivalent of DllMain on OSX?

Mark Isaacson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 25 14:22:59 PDT 2014


I am presently trying to port a driver I wrote for Windows to 
OSX. The one thing standing in my way is figuring out how to get 
the equivalent of DllMain on OSX.

I need a place to call Runtime.initialize() and whatnot.

Reading the wiki, it seemed like `shared static this()`  was the 
appropriate construct to use, and indeed, when I run the test 
program from:
http://dlang.org/dll-linux.html#dso9

I get the desired results: namely, I see that the `shared static 
this()` in that test program is called the desired point.

When I try the same thing in my driver, it is never executed.

Are dylibs on OSX not supported still (I saw some very old 
threads from 2012 stating as much)? Does it matter that I have 
multiple modules in the driver? Any help would be appreciated.

I shall endeavor to get the modified driver code into a state 
where I can link it as well.


More information about the Digitalmars-d-learn mailing list