|
From: ALEXANDRE B. G. <gre...@ig...> - 2008-12-25 18:51:29
|
Hi there,
I am trying a problem when I compile the follow program
#include<windows.h>
#include<winsock.h>
int do_something(){
SOCKET socket_handle=socket(PF_INET, SOCK_DGRAM, 0);
if(socket_handle==INVALID_SOCKET){
return(0);
}
closesocket(socket_handle);
return(1);
}
I have got these messages
C:\MinGWStudio\Programs\ksocket\ksocket.c:8: undefined reference to `socket@12'
C:\MinGWStudio\Programs\ksocketl\Debug\ksocket.o(.text+0x3e):C:\MinGWStudio\Programs\ksocket\ksocket.c:13:
undefined reference to `closesocket@4'
I think that I must link the program to winsock.dll. Is that rigth?
How can I do this?
Thanks in advance
|