delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/08/18:51:56

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT redhat DOT com>
Date: Mon, 8 Jan 2001 18:10:06 -0500
To: cygwin AT cygwin DOT com
Cc: ecelca AT yahoo DOT com
Subject: Re: HELP: How to link with Winsock2 library?
Message-ID: <20010108181006.D1327@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, ecelca AT yahoo DOT com
References: <20010108200035 DOT 15560 DOT qmail AT web10702 DOT mail DOT yahoo DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
yrom: Christopher Faylor <cgf AT redhat DOT com>
In-Reply-To: <20010108200035.15560.qmail@web10702.mail.yahoo.com>; from ecelca@yahoo.com on Mon, Jan 08, 2001 at 12:00:35PM -0800

On Mon, Jan 08, 2001 at 12:00:35PM -0800, ece lca wrote:
>  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 <windows.h>
>#include <winsock2.h>
>
>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.

g++ -o main main.cpp -lws2_32
                     ^^^^^^^^

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019