DLLs and headaches

Unknown W. Brackets unknown at simplemachines.org
Mon May 4 02:32:51 PDT 2009


D2; but actually, it kinda works.  It crashes on freeing the library, 
but it loads fine.

If I use std.stdio, link says that primary.__ModuleInfo is missing, but 
that just means it crashes during compile/link.

That said, I'm very dissapointed that Runtime doesn't support Posix yet. 
  Means I'll have to roll it myself anyway.

-[Unknown]


Don wrote:
> Unknown W. Brackets wrote:
>> This is kinda complicated, hopefully someone will still read it and 
>> try it.
>>
>> DLLs typically don't have access to the host process.  Sometimes, when 
>> creating plugins, such access may be desirable.  The typical solution 
>> is to have the host and plugins both load a secondary DLL.
>>
>> I've tried to replicate this with D.  I have a stub program, a 
>> "primary" dll, and a "plugin" dll.
>>
>> Although the solution in itself does work, I'm having a lot of 
>> problems and they seem related to D.  But, maybe I'm just doing it all 
>> wrong?
>>
>> If I import std.stdio in a DLL, it won't compile.  Period.  Otherwise, 
>> the primary DLL never finishes - it just dies when it frees the plugin 
>> library.
> 
> Is this D1 or D2?
> If D2 -- I haven't been able to get D2 DLLs to work at all. They just 
> crash during the initialization (something to do with initialising the 
> thread-locals, I think, but I haven't been able to track it down 
> completely).


More information about the Digitalmars-d-learn mailing list