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:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; q=dns; s=default; b=BxgI2EZ 9EGLONzQhiwijtyg7W9X6WmhaOleN8lYp3HnJwQQIR604rdwHSZ0yjxJVezAcPAj 3IJlq+YO8BRXldg34IDtX6AmirxEhVd+nK/JNluS0y66Yv6VbvUg6yJqNuUhj2li vjZNio7JRK7kecy+rlOPoKu9d3+HFtFyT6jg= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=default; bh=zBEgZEQRGeXHM 1Xs0pgZ7RbDQ7Q=; b=dJg62d6+KHgLFNKOiSL6nqx9TNFLZYaZSTQZacknn1Q7w cRAt6vEGXC18laTQWHC01Nrj1TEF1FyOtYh7gm058nqqMLVaxhPLoFKkTYbkjo2x MZK7a/gVQcmcgenMFZP2ulLY7wb1gVekFC1KL9KSchYOdO2WoG+LIAa3Dw/WRc= 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-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 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 11:15:16 +0200 Message-ID: Subject: Re: How does linker choose library with same function export? To: cygwin list Content-Type: text/plain; charset="UTF-8" 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