This is the mail archive of the
mailing list for the Cygwin project.
Re: Another problem with DLL's
- To: "Valery Fine" <Valeri dot Faine at cern dot ch>
- Subject: Re: Another problem with DLL's
- From: John Cerney <j-cerney1 at ti dot com>
- Date: Fri, 21 Mar 1997 08:05:21 -0800
- Cc: gnu-win32 at cygnus dot com
- Conversation-Id: <199703210841.JAA24462@sp050.cern.ch>
- Reply-To: John Cerney <j-cerney1 at ti dot com>
> > I'm not sure what is wrong with your code, but I know this does
> > work. Here is a simple example of loading a DLL at runtime using
> > LoadLibraryEx calls. This compiles and links fine on both win95 and
> > winNT.
> Hello John!
> Just one question. Did you try to compile your MAIN with VC++ but
> DLL with gnu-win32 ? Does it work ?
I just tried compiling the main2.c with VC++.
When running, the thing crashes when the DLL function is called. An access
violation occurs in cygwin.dll. The foo.dll that is built uses cygwin.dll for
its printf function. If I take the printf out of the foo.dll code the VC++
main2.exe will run just fine.
I think when a gnuwin32 main program is linked, some code to initialize the
cygwin system is included. Since we compile the main program here using VC++, I
suspect that the cygwin.dll never gets initialized, and crashes when its
functions are called. It is possible that this might be fixed by adding some
initialization routines to the dll_entry routine for the dll.
For help on using this list, send a message to
"firstname.lastname@example.org" with one line of text: "help".