From: SourceForge.net <no...@so...> - 2006-06-10 14:14:59
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3770772 By: crusty82 Hello there. I just installed GCC (candiate version from MingW), i took the core package, the objc package, the runtimes, and the bintools. I tried to create a very simple winsock application, but even if i only include the winsock2.h into a simple hello world program, it cannot be compiled anymore. All links are broken as it seems, and all my efforts to make it work failed. It looks like the winsock lib was not linked at all. what could i do to fix this? any help is very much appreciated :) code: #include <stdio.h> #include <winsock2.h> int main(int argc, char *argv[]) { printf("hello, world!"); } error : gcc.exe UDPClient.c -o UDPClient.c.exe In file included from C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x38): undefined reference to `getservbyname@8' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x67): undefined reference to `htons@4' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x95): undefined reference to `gethostbyname@4' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0xd3): undefined reference to `inet_addr@4' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x137): undefined reference to `WSAStartup@8' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x17f): undefined reference to `socket@12' C:\DOKUME~1\Crusty1\LOKALE~1\Temp/ccyGaaaa.o:UDPClient.c:(.text+0x1c4): undefined reference to `connect@12' collect2: ld returned 1 exit status ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=7134 |