Subject: Re: dllwrap and excluded symbols
From: Tim Reed <[email-masked]>
To: DJ Delorie <[email-masked]>
Cc: [email-masked]
Date: Tue, 10 Oct 2000 14:06:49 -0700 (PDT)

The problem I'm having is coming up in Windows 2000. I'm writing a dll
in C with the Cygwin tools. This dll is loaded by another dll compiled
with Visual Basic. My cygwin compiled dll needs to load things like crtdll
and the like. It does not use cygwin1.dll. It works fine in Win98 but
fails in Windows 2000. 

Using Taskinfo2000 and a debugger I've noticed that the dll just doesn't
load in the C runtime dlls in Win2k. Consequently, when that dll makes a
call to malloc I get a Memory Access Violation since the symbol wasn't
resolved to a valid address.

Would you recommend that I write an entry point that just calls
LoadLibrary on the needed dlls?

I realize you might not know the inner workings of mingw, but do you know
where I get this kind of info?

Thanks for you help.

On Tue, 10 Oct 2000, DJ Delorie wrote:

> 
> > Does that mean that I can't have my dll load other dll's implicitly?
> > Do I have write my own DllMainCRTStartup function that will load in
> > crtdll and msvcrt?
> 
> The problem you are seeing has nothing to do with loading dlls, either
> implicitly or explicitly.
> 
> Every DLL needs to have an "entry point" (like main() in a C program).
> Windows calls this entry point when *it* loads the DLL, so that the
> DLL can initialize itself.  NOBODY ELSE calls these entry points, so
> exporting them is *dangerous*.  Thus, the linker knows to ignore the
> "common" entry point names.
> 
> You should write an entry point function, but if you don't *and* link
> with libcygwin.a, one will be provided for you.  If you don't use
> cygwin, I don't know what mingw does for you.
> 

--
Want to unsubscribe from this list?
Send a message to [email-masked]