000
13.02.2007, 18:27 Uhr
~hallo
Gast
|
Hallo
C++: |
#include <winsock2.h> #include <iostream>
#pragma comment(lib, "ws2_32.lib")
using namespace std;
int main() { WSADATA wsa; WSAStartup (MAKEWORD (1,1) ,&wsa);
SOCKET s; s = socket (AF_INET, SOCK_STREAM, 0 ); sockaddr_in addr; addr.sin_addr.s_addr = inet_addr("192.168.1.35"); addr.sin_port = htons (1001); addr.sin_family = AF_INET;
if(connect(s, (struct sockaddr*)&addr, sizeof(addr)) == -1) cout<<"Fehler beim connect";
send(s, "X", 1, 0);
cout<<"\nEnde"; cin.get(); return 0; }
|
habe versucht dieses Programm mit Dev C++ 4.9.9.2 zu compilieren.
[Linker error] undefined reference to `WSAStartup@8' [Linker error] undefined reference to `socket@12' [Linker error] undefined reference to `inet_addr@4' [Linker error] undefined reference to `htons@4' [Linker error] undefined reference to `connect@12' [Linker error] undefined reference to `send@16' ld returned 1 exit status
Diese Fehlermeldungen werden angezeigt. Kann es sein, dass ich irgendwelche Updaten laden muss damit ich sockets compilieren kann?
Danke |