X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Subject: Re: Using a Cygwin-built DLL outside of Cygwin From: Christian Kreibich To: cygwin AT cygwin DOT com Cc: Thorsten Kampe In-Reply-To: References: <1192647409 DOT 21421 DOT 528 DOT camel AT strangepork> Content-Type: text/plain Date: Thu, 18 Oct 2007 09:42:20 -0700 Message-Id: <1192725741.21421.575.camel@strangepork> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi Thorsten, On Wed, 2007-10-17 at 23:53 +0100, Thorsten Kampe wrote: > > My questions: > > > > - Is there a Cygwin-only way to avoid the MSVC lib command detour, to > > avoid the "multiple .text sections" issue? > > > > - I have gleaned from related postings and FAQ 6.12 that the crashes are > > due to the use of cygwin1.dll and msvcrt.dll (and/or related Windows > > DLLs) in the same executable. Is this correct? > > > > - If so, is there a way to avoid the problem while still building the > > library in my cozy Cygwin/POSIX environment? My understanding is that > > -mno-cygwin doesn't help in that regard (per FAQ 6.10), and that I have > > to keep cygwin1.dll (per FAQ 6.11). > > > > - If getting rid of msvcrt.dll is the answer, what are the implications > > for building Windows-native applications? (And, assuming this is > > possible, if a kind soul could tell me how I'd go about doing this even > > though it's not a question at the heart of this list, that'd be much > > appreciated...) > > Aren't these FAQs? I hope not. :) For starters, I don't think my first question has anything to do with the FAQs you're pointing out. > * Can I link with both MSVCRT*.DLL and cygwin1.dll? > http://cygwin.com/faq/faq.programming.html#faq.programming.msvcrt-and- > cygwin Yes. As I mentioned above, I have actually read those. My second question is whether the crashes I am seeing are likely to be a consequence of this. > * How do I use cygwin1.dll with Visual Studio or MinGW? > http://cygwin.com/faq/faq.programming.html#faq.programming.msvs-mingw Thanks for pointing this one out. This may answer my last two questions, and I'd in fact seen the FAQ entry, but wrote it off to a serious case of impedance mismatch. I found how-cygtls-works.txt at http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/how-cygtls-works.txt?rev=1.1&content-type=text/plain&cvsroot=src and read it. Unfortunately it is unclear how a discussion of the NT_TIB structure from relates to my question. The other reference, winsuite/testsuite/cygload, appears to be emptry: http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/testsuite/cygload/?cvsroot=src I'll now try to get this snippet also mentioned in the FAQ to work: HMODULE h = LoadLibrary("cygwin1.dll"); void (*init)() = GetProcAddress(h, "cygwin_dll_init"); init(); Cheers, Christian -- ________________________________________________________________________ http://www.icir.org/christian http://www.whoop.org -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/