Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <40F4B4C5.8070101@cwilson.fastmail.fm>
Date: Wed, 14 Jul 2004 00:21:25 -0400
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 MultiZilla/1.6.2.0c
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: dlopen under cygwin
References: <40F3FE73.8030906@emirates.net.ae> <14424054438.20040713181141@familiehaase.de>
In-Reply-To: <14424054438.20040713181141@familiehaase.de>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Gerrit P. Haase wrote:
> Maarten wrote:
> 
> 
>>Hi all,
> 
> 
>>Is dlopen() & friends supported under cygwin? If so, is the DLL that 
>>gets loaded using dlopen() a regular Win32 DLL, or a 'special' type of
>>cygwin DLL?
> 
> 
> dlopen() works and one should use it.
> 
> 
>>Reason I ask it that (while trying to get 'plugins' to work under 
>>cygwin) I had a look at the gmodule source code of glib, and it seems 
>>that gmodule uses regular Win32 LoadLibrary() calls to load the DLL, 
>>instead of calling dlopen(). I was wondering if that it actually correct.
> 
> 
> This seems to work too, but is it not portable, dlopen() is used for
> Linux applications and needs not to be ported when building with
> Cygwin, it just works the same way as for Linux.

Except, as I mentioned before, cygwin's glib2 package is built in such a 
way that it, too, uses LoadLibrary directly and not dlopen.  (IIRC, 
doing it "right" requires a patch to the gmodule stuff -- and I agree 
with the maintainer's decision to go ahead with the glib2 package 
rollout with LoadLibrary and delay the dlopen stuff until later, since I 
raised the flag on the issue so late in the game).

I only mention this glib issue because the original poster had already 
indicated he downloaded and investigated glib...and I wanted to clarify 
why even the cygwin version currently uses LoadLibrary -- even tho 
Gerrit's statement that "you should use it [dlopen]" is correct.

--
Chuck

--
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/

