Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <20010108200035.15560.qmail@web10702.mail.yahoo.com> Date: Mon, 8 Jan 2001 12:00:35 -0800 (PST) From: ece lca Subject: HELP: How to link with Winsock2 library? To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I am a green hand at cygwin programming. I tried to compile a winsock program but I kept get linking errors. I reduced the program to the simplest form, as below: #include #include void main(){ SOCKET socket; closesocket(socket); } When I tried to compile it with g++ -o main -lws2_32 main.cpp I got error message: /cygdrive/c/TEMP/cc8N0jmo.o(.text+0x13):main.c: undefined reference to `closesocket AT 4' Could you help me? Thank you very much. Yue Luo __________________________________________________ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/ -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple