X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:subject:mime-version:content-type :content-transfer-encoding:date:from:message-id; q=dns; s= default; b=IKvIEDLHUGbfhjTPMDSKBB/5E5peJ/ekspeLEYqhj+upGwObnAv9j WGsrIhtTKl6+ofyRLT/q+2iUke3o4xTe+FCmTvn+GYqH5xxe9h65vJL6w/s+WK7l YAb8HhjVDNbRustj3B93k5lPqKxutN2o9h7A0l0/niGOSazvi/5XXY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:subject:mime-version:content-type :content-transfer-encoding:date:from:message-id; s=default; bh=6 6nK6OLlKBXAhI8fu/blW9HF9T0=; b=YGLLqy5ZJ1rfJw7mmMfQsOrXAT41bTkAe Tb+eA+TWrJKEHmtugHyKxVyNW+KuFHDGSV7T/v+MLVGYWjV79+0NTEImf8pQTIMo 7mRJu8etc6TfDSbkVdVmL1b5bvbPCh/Xv4o8YgnyIF12H7LAAgdtvHuoOjDrMDf2 ZFp8VLMagA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp-out-so.shaw.ca X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=2JCJgTwv5E4A:10 a=w_pzkKWiAAAA:8 a=B1cO1FHFgjdHsZDA0AEA:9 a=QEXdDO2ut3YA:10 a=MP2Ns1xdqCcA:10 a=sRI3_1zDfAgwuvI8zelB:22 To: cygwin AT cygwin DOT com Subject: Re: Problem with differences with DLOPEN / DLSYM compared to ubuntu (16.04) / debian (stretch). X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Date: Thu, 14 Sep 2017 18:15:51 -0700 From: Kaz Kylheku <920-082-4242 AT kylheku DOT com> Message-ID: X-Sender: 920-082-4242 AT kylheku DOT com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfLYgwZn5tx0g6C0SUKy2fjL5nLY6sQaDUuZFkypglKhXbbqPT3N9DT8mN/ijPhFr5pzFgERtbdGydfO0LbQthnHn2eELMVBP/boU5v3tSS2oR92QcTY9 wimPP+oXxlNH44saH7dKRlTTCsNB211GjSbVz7ccnNVVlAJbQhZw7M3d X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v8F1G4vN000474 On 14.09.2017 08:44, Gary Schneir wrote: > Can anyone provide some assistance to understanding the differences and > a way get a single code base to work in all three environments without > naming the library file? On Cygwin, libraries are Windows DLL's. That appears to be a conscious project decision. The TL;DR is that Windows DLL's are not going to give you the behaviors of ELF shared libraries on GNU/Linux. Cygwin would probably have to whip up its own shared library format for that, or port one. The complication doesn't seem worth it. You can think of dlopen as a wrapper around LoadLibrary, and dlsym doing GetProcAddress. In Windows programming, doing GetProcAddress on symbols within an .exe is something that isn't normally done; it's not clear that it is supposed to work at all. For it to even have any hope of working, the function would have to be somehow declared "dllexport" (in Visual C terms). I think the shared lib building mechanism under Cygwin hides that; there is no Visual C __declspec(dllexport) stuff: See: https://cygwin.com/cygwin-ug-net/dll.html Still, the toolchain has to be arranging for the equivalent of __declspec(dllexport) for the external symbols. It's probably not configured to do that for the symbols in a regular executable. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple