delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/10/17:16:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Tue, 10 Oct 2000 14:06:49 -0700 (PDT)
From: Tim Reed <timr AT viaworks DOT com>
To: DJ Delorie <dj AT delorie DOT com>
Cc: cygwin AT sources DOT redhat DOT com
Subject: Re: dllwrap and excluded symbols
In-Reply-To: <200010102057.QAA12754@envy.delorie.com>
Message-ID: <Pine.LNX.4.10.10010101400300.16454-100000@vserver.viaworks.com>
MIME-Version: 1.0

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 cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019