X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=0.5 required=5.0	tests=AWL,BAYES_05,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4C056CD5.1080006@gmail.com>
Date: Tue, 01 Jun 2010 16:25:57 -0400
From: James Rome <jamesrome@gmail.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: linker switches
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

I am doing a C project in NetBeans 6.9RC1, in Windows 7 64-bits.
Using the latest Cygwin tool set, I get linker errors from winsock2.
Please tell me what switches I have to use to get link to work.  I'd
also like to get rid of the fd_set error. I am not including sys/types
anywhere.

Thanks,
Jim

....
gcc.exe    -c -g -MMD -MP -MF
build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o.d -o
build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o src/tkfPusher.c
In file included from src/tkfPusher.c:26:
/usr/include/w32api/winsock2.h:103:2: warning: #warning "fd_set and
associated macros have been defined in sys/types.      This may cause
runtime problems with W32 sockets"
mkdir -p dist/Debug-Cygwin/Cygwin_4.x-Windows
gcc.exe     -o dist/Debug-Cygwin/Cygwin_4.x-Windows/tkfpush
build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o 
build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o: In function `main':
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:173: undefined
reference to `_WSAStartup@8'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:182: undefined
reference to `_socket@12'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:185: undefined
reference to `_WSAGetLastError@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:186: undefined
reference to `_WSACleanup@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:195: undefined
reference to `_inet_addr@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:196: undefined
reference to `_htons@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:203: undefined
reference to `_connect@12'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:212: undefined
reference to `_WSACleanup@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:220: undefined
reference to `_send@16'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:221: undefined
reference to `_send@16'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:223: undefined
reference to `_send@16'
build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o: In function
`getFirstFreePort':
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:300: undefined
reference to `_WSAStartup@8'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:309: undefined
reference to `_socket@12'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:312: undefined
reference to `_WSAGetLastError@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:313: undefined
reference to `_WSACleanup@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:318: undefined
reference to `_inet_addr@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:323: undefined
reference to `_htons@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:325: undefined
reference to `_bind@12'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:331: undefined
reference to `_closesocket@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:332: undefined
reference to `_WSACleanup@0'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:337: undefined
reference to `_closesocket@4'
/cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:338: undefined
reference to `_WSACleanup@0'
make[2]: Leaving directory `/cygdrive/c/Users/jar/GraphiC2/tkfPush'
make[1]: Leaving directory `/cygdrive/c/Users/jar/GraphiC2/tkfPush'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug-Cygwin/Cygwin_4.x-Windows/tkfpush.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 2s)



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

