delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/22/13:22:01

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20031022172058.66718.qmail@web303.mail.yahoo.co.jp>
Date: Thu, 23 Oct 2003 02:20:58 +0900 (JST)
From: Takeshi Honda <moecho21 AT yahoo DOT co DOT jp>
Subject: Can't link to libws2_32.a
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

Hi,

I have a problem to compile my socket program.
I want to use winsock2.h, but when I compiled my program,
I got the following errors.

%gcc -lwsock32 -lws2_32 main.cpp
main.cpp: undefined reference to `WSASocketA AT 24'
main.cpp: undefined reference to `WSAIoctl AT 36'
main.cpp: undefined reference to `htons AT 4'
main.cpp: undefined reference to `bind AT 12'
main.cpp: undefined reference to `WSAIoctl AT 36'
main.cpp: undefined reference to `WSAStartup AT 8'
main.cpp: undefined reference to `WSACleanup AT 0'
main.cpp: undefined reference to `WSARecv AT 28'
main.cpp: undefined reference to `WSAGetLastError AT 0'
main.cpp: undefined reference to `WSARecv AT 28'
main.cpp: undefined reference to `WSAGetLastError AT 0'
collect2: ld returned 1 exit status

DLL version is  1.3.12.
I wrote program header as follows.

#define Win32_Winsock
#include <windows.h>
#include <winsock2.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>

I searched google and ML archive, but I couldn't get
enough information to solve this.
What can I do for this?
Please let me know.

Thanks,

Takeshi Honda

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


--
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/

- Raw text -


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