[Dev-C++] Linking error (help please!)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: de S. <fla...@se...> - 2001-11-17 18:36:56
|
Hi !
I am trying to compile and linking this simple code:
#include <winsock.h> // winsock.h always needs to be included
#include <stdio.h>
#include <windows.h>
//Prototypen
int startWinsock(void);
int main(int argc, char *argv[])
{
long rc;
rc=startWinsock();
if(rc!=0)
{
printf("Error: startWinsock, error code: %d\n",rc);
return 1;
}
else
{
printf("Winsock started!\n");
}
return 0;
}
int startWinsock(void)
{
WSADATA wsa;
return WSAStartup(MAKEWORD(1,1),&wsa);
}
But I got this error:
c:\meus documentos\projetos\sistema de
e-mails\source\socketconnection\socket_test\socket_t2.o(.text+0xad):socket_t2.cpp:
undefined reference to `WSAStartup@8'
I don't know what causes this, do you have any ideas?
Probably it is a silly error.
Tks,
Flavio.
Flavio de Souza
fla...@ne...
ICQ:78458203
|