I am trying a program to open a socket. Have the following declarations:
#include <stdio.h> #include <winsock2.h> #include <windows.h> #include <process.h> #include <string.h> #include <winbase.h> #pragma comment(lib,"ws2_32")
that pass compilation, but later when try to use some items got the following error from compiler
...
C:/DOCUME~1/wil/LOCALS~1/Temp/ccM3aaaa.o(.text+0x38b):dcom1.c: undefined reference to `WSAStartup@8'
C:/DOCUME~1/wi/LOCALS~1/Temp/ccM3aaaa.o(.text+0x39d):dcom1.c: undefined reference to `WSAGetLastError@0'
C:/DOCUME~1/wil/LOCALS~1/Temp/ccM3aaaa.o(.text+0x3d1):dcom1.c: undefined reference to `htons@4'
C:/DOCUME~1/wil/LOCALS~1/Temp/ccM3aaaa.o(.text+0x3eb):dcom1.c: undefined reference to `inet_addr@4'
C:/DOCUME~1/wil/LOCALS~1/Temp/ccM3aaaa.o(.text+0x402):dcom1.c: undefined reference to `socket@12'
....
Could you please indicate what is missing?
Rgds, Paulo