From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nigel Wetten To: cygwin@sources.redhat.com Subject: Re: crash using _environ from libmsvcrt20/40.a Date: Thu, 14 Sep 2000 07:14:00 -0000 Message-id: <39C0DD0E.27767729@e-14.com> References: <39BF6F25.45A7BBB0@e-14.com> <20000913091355.A16305@cygnus.com> <39BF8E90.AC37ADA@e-14.com> X-SW-Source: 2000-09/msg00479.html > > MSVCRT*.DLL and Cygwin1.dll are mutually exclusive. You can't mix them. > > > > If you want to use MSVCRT*.DLL use the -mno-cygwin option when you compile > > and link. > > Thanks, I've added that, and objdump -p confirms that the binary does > not use cygwin.dll, BUT the program still faults in the same way. For the benefit of anyone who's interested, and didn't already know: extern __declspec(dllimport) char **_environ; is what was needed. I had tried using the msvc++ header for _environ(stdlib.h), but it doesn't use declspec, and I couldn't find any cygwin header that had _environ in it. The object code generated for accessing _environ now has an extra layer of indirection in it. Unfortunately, my real motivation here is to link a msvc object(I don't have the source) which needs _environ. The object code in it does not have this extra layer of indirection in it. I'm not sure whether I can use libmsvcrt.a in the link now. Kudos to Benny Riefenstahl for clueing me in. Nigel -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com