Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Thu, 30 Jun 2005 16:36:13 -0700 (PDT) Message-Id: <200506302336.j5UNaDsY010535@lymeon.ucdavis.edu> To: Brian Dessent , cygwin AT cygwin DOT com Subject: Re: load a shared lib created using gcc/Cygwin From: "Yu-Cheng Chou" X-Errors-To: cycchou AT magenta DOT ucdavis DOT edu X-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) X-IsSubscribed: yes Hi, I made a mistake in the previous reply. Here I state my question again. mylib.dll was built using gcc/cygwin based on some library that might depends on cygwin1.dll. I don't want to load cygwin1.dll explicitly, but I do need to load mylib.dll dynamically at run-time in an application which was built by Visual C++ or .NET. How should I do? Thanks > > Can a shared library mylib.dll built using > > gcc -shared -o mylib.dll file.c > > be loaded dynamically at run time by function > > LoadLibrary("mylib.dll") in an application built using > > Visual C++ or .NET? > > I tried it in Windows XP with the latest version of > > gcc/Cygwin, the application will hang > > at LoadLibrary("mylib.dll"). > > If mylib.dll depends on cygwin1.dll then this will not work. To load > the Cygwin DLL dynamically requires special attention, as described in > the FAQ: and recent mailing > list > threads, as this is a very recent ability. > > If mylib.dll does not need functionality from Cygwin, then you should > compile it with -mno-cygwin, and it will be dynamically loadable without > extra care just like a standard windows DLL. More information about > this is at . If you go this route you > are no longer using Cygwin so your questions should really be addressed > to the mingw list. > > Brian -- 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/