This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: load a shared lib created using gcc/Cygwin
- From: "Yu-Cheng Chou" <cycchou at ucdavis dot edu>
- To: Brian Dessent <brian at dessent dot net>, cygwin at cygwin dot com
- Cc: hhcheng at ucdavis dot edu
- Date: Thu, 30 Jun 2005 15:47:24 -0700 (PDT)
- Subject: Re: load a shared lib created using gcc/Cygwin
Hi,
I want to load the cygwin1.dll with Visual Studio following
the instruction from http://cygwin.com/faq/faq.html#SEC102.
But I can't find winsup/cygwin/how-cygtls-works.txt and the sample code
in winsup/testsuite/cygload.
So where can I find these files?
Thanks
> Yu-Cheng Chou wrote:
>
> > 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: <http://cygwin.com/faq/faq.html#SEC102> 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 <http://www.mingw.org/MinGWiki/>. 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/