From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49021 invoked by alias); 20 Oct 2019 09:15:45 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 48949 invoked by uid 89); 20 Oct 2019 09:15:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=mixing, scott, Scott, csaba X-HELO: mail-qk1-f181.google.com Received: from mail-qk1-f181.google.com (HELO mail-qk1-f181.google.com) (209.85.222.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 20 Oct 2019 09:15:35 +0000 Received: by mail-qk1-f181.google.com with SMTP id e66so9395594qkf.13 for ; Sun, 20 Oct 2019 02:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=liPBp4INdK6ceAZOnpGZfi63iOKX/zI4C4S6qaWI3sI=; b=O9eTjA+m21W19+4IBBc1ck0WMJfZLV1jJdkbmBcbeQPQVsQGKYw150JVHoFOEJiX6p 6NPOdgFFYbY7f5zSu4RYSHLYCRjW6bzhFJZ7UuAHlJji8EvLOuugamrWYxIlLv44pzW3 WzbmPMf/JLIF0gRUbDfTNxj4WZ5FLwiWGkEg0oAYhEC1hCwxxtPRDGKbWc5VHA0lo4rz Q0wjfkh8ZLpocPmlo58tnLgRSoO5wNO+1uw0X4OeyiB4vPODPFSzUnQ96d7oZDAeMI9z L6TB5uqoJlNKya7qVsGnhAJFF3TGZHILwzHPWZoL2o7MrALFNSBYPkI1uRYTk2WJ+o4d 5iQg== MIME-Version: 1.0 References: In-Reply-To: From: Csaba Raduly Date: Sun, 20 Oct 2019 09:15:00 -0000 Message-ID: Subject: Re: How does linker choose library with same function export? To: cygwin list Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-10/txt/msg00114.txt.bz2 Hi, On Sat, Oct 19, 2019 at 2:57 PM Biswapriyo Nath wrote: > > I want to use socket() from ws2_32.dll file. But cygwin1.dll also has that > export. When I use `-lws2_32` option, will gcc **always** choose > ws2_32.lib? My query is somewhat similar with FAQ #5.11. I think the FAQ is pretty clear: "5.11. I don't want Unix sockets, how do I use normal Win32 winsock? You don't. " You shouldn't look at Cygwin programs as if they were Windows programs. Cygwin is a POSIX environment. You either create a Cygwin program and use the POSIX functions, or you create a Windows program (you can cross-compile Windows programs under Cygwin). Mixing the two is likely to run into problems, and you aren't going to get much help when you were told "don't do it" at the very beginning. Csaba -- You can get very substantial performance improvements by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler So if you're looking for a completely portable, 100% standards-conformant way to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK) -- 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