Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 From: "Dave Korn" To: Subject: RE: URGENT HELP: How does a cygwin.dll by passes ws2_32.dll? Date: Tue, 16 Nov 2004 13:17:21 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <80A07E7023257741B258296933B7426CBA8742@ubiinmbx01.am-main.ubinetics.com> Message-ID: X-OriginalArrivalTime: 16 Nov 2004 13:17:21.0109 (UTC) FILETIME=[9AA7E850:01C4CBDE] > -----Original Message----- > From: cygwin-owner On Behalf Of Nagamani Veerappa > Sent: 16 November 2004 06:31 > Dear experts, > > I wonder how can a exe compiled using gcc on cygwin by passes > ws2_32.dll? > > Basically I have a windows program compiled using MSVC, need > to use socket > interfaces provided by cygwin... > I tried linking cygwin1.dll with MSVC, with the great help of > ALastair, who > had written tips (in this forum) to achieve that. Just because you've successfully linked two incompatible object files together doesn't mean that what you have is valid code. The symbols may match up but nothing guarantees the data structures, ABI, functionality, or anything else actually match up. > But it seems cygwin1.lib/cygwin1.dll doesnot seems to expose socket > interfaces.. " nm /bin/cygwin1.dll | grep sock " says you're wrong: here are just some of the symbols it finds 610d7128 T _closesocket AT 4 610d7298 T _getsockname AT 12 610d72b8 T _getsockopt AT 20 610d7340 T _ioctlsocket AT 12 610d7480 T _setsockopt AT 20 610d74c0 T _socket AT 12 6104a6b0 T _socketpair ..etc etc. That looks a lot like it's "exposing socket interfaces" to me. > If I link with ws2_32.lib it links with ws2_32.dll .. > Which I don't want... So, let me get you clear: you're saying that if you link with ws2_32, it gets linked to ws2_32, and you don't want that? Well just don't do that then! > So please help, by answering how can I bypass ws2_32.dll? Simple. Just spend the next ten years writing your own POSIX compatibility dll that uses microsoft's runtime. It won't be open source, of course, because microsoft's runtime libraries aren't, but it will do what you want. Look. Either write a win32 program using MSVC, which is the compiler for writing win32 programs, (or indeed using gcc -mno-cygwin, which means you can't use cygwin functions), or write a POSIX program using gcc and cygwin library. Your question is a bit like saying "I use a tape recorder to make tape recordings and a camera to take photographs. How can I use my tape recorder to take photos?" cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/