This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error compiling code using winsock functions


David None wrote:
> 
> Hi there, thanks for the reply, but I've tried the methods suggested (just
> using windows.h and #define Win32_Winsock), also as Win32_Winsock is
> deprecated, I also tried defining __USE_W32_SOCKETS
> but I'm still receiving the same error:
> 
> I get the following error:
> "iphdrinc.o(.text+0x820):iphdrinc.c: undefined reference to '_WSASocketA@24'
> collect2: ld returned 1 exit status"
> 
> hopefully some more ideas are floating around ? =)

$ find /lib/w32api/ -name \*.a | xargs nm -o | grep -i wsasocketa
/lib/w32api/libws2_32.a:ds00061.o:00000000 T WSASocketA@24
/lib/w32api/libws2_32.a:ds00061.o:00000000 I _imp__WSASocketA@24


Try "-lws2_32" on your gcc line.

Brian

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]