| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <42C46687.80A1B5E6@dessent.net> |
| Date: | Thu, 30 Jun 2005 14:39:19 -0700 |
| From: | Brian Dessent <brian AT dessent DOT net> |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: load a shared lib created using gcc/Cygwin |
| References: | <200506302128 DOT j5ULSnbI022603 AT cucujus DOT ucdavis DOT edu> |
| X-Spam-Report: | -5.9/5.0 ---- Start SpamAssassin results * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 0.0 AWL AWL: From: address is in the auto white-list ---- End SpamAssassin results |
| X-IsSubscribed: | yes |
| Reply-To: | cygwin AT cygwin DOT com |
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |