apologies for forced a new thread for this but I mstart out in homesock and have been following through madwizard 和 Guide, 以及一些关于msdn的信息。 我 st不 st,我似乎汇编了以下材料(即:P.)。
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(void){
const int iReqWinsockVer = 2; //
WSADATA wsadata;
if (WSAStartup(MAKEWORD(iReqWinsockVer,0), &wsadata) == 0 ){
if (LOBYTE(wsadata.wVersion) >= iReqWinsockVer){
}
else{
cout<<" Required version Not available..." << endl;
}
if (WSACleanup()!=0){
cout<<"Clean up failed!..." << endl;
}
}
else{
cout<<"Startup faled!..." << endl;
}
return 0;
}
I m 收到以下错误:
C:DOCUME~1
sLOCALS~1Temp/ccygafwl.o:sock.cpp:(.text+0x14a): undefined reference to `WSAStartup@8
C:DOCUME~1
sLOCALS~1Temp/ccygafwl.o:sock.cpp:(.text+0x186): undefined reference to `WSACleanup@0
collect2: ld returned 1 exit status
我利用海合会,通过指挥线进行汇编,是我必须联系起来的吗?
- 你。