Hallo zusammen,
Ich lese mir gerade das auf http://www.c-worker.ch/tuts/wstut_op.php durch und schon nach den ersten paar abschnitten bekomm ich das probelm, das mein compiler mir diese fehlermeldung ausgibt
der code aus dem tutorial ist:
was mach ich falsch?
Ich lese mir gerade das auf http://www.c-worker.ch/tuts/wstut_op.php durch und schon nach den ersten paar abschnitten bekomm ich das probelm, das mein compiler mir diese fehlermeldung ausgibt
Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : D:
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.c
Linking console executable: D:\Beispiel.exe
.objs\main.o:main.c.text+0x87): undefined reference to `WSAStartup@8'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
der code aus dem tutorial ist:
Code:
#include <windows.h>
#include <winsock2.h>
#include <stdio.h>
//Prototypen
int startWinsock(void);
int main()
{
long rc;
rc=startWinsock();
if(rc!=0)
{
printf("Fehler: startWinsock, fehler code: %d\n",rc);
return 1;
}
else
{
printf("Winsock gestartet!\n");
}
return 0;
}
int startWinsock(void)
{
WSADATA wsa;
return WSAStartup(MAKEWORD(2,0),&wsa);
}
was mach ich falsch?