一个让人头疼的简单问题!!(急,在线等)
我在vs.net环境中写一个网络连接程序,但是连接总是有错,其中一些错误为
正在编译...
stdafx.cpp
正在编译...
test.cpp
AssemblyInfo.cpp
正在生成代码...
正在编译资源...
正在链接...
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall WSACleanup(void)" (?WSACleanup@@$$J10YGHXZ)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall closesocket(unsigned int)" (?closesocket@@$$J14YGHI@Z)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall recv(unsigned int,char *,int,int)" (?recv@@$$J216YGHIPADHH@Z)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall send(unsigned int,char const *,int,int)" (?send@@$$J216YGHIPBDHH@Z)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall connect(unsigned int,struct sockaddr const *,int)" (?connect@@$$J212YGHIPBUsockaddr@@H@Z)
test.obj : error LNK2001: 无法解析的外部符号 "unsigned int __stdcall socket(int,int,int)" (?socket@@$$J212YGIHHH@Z)
test.obj : error LNK2001: 无法解析的外部符号 "unsigned short __stdcall htons(unsigned short)" (?htons@@$$J14YGGG@Z)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall WSAGetLastError(void)" (?WSAGetLastError@@$$J10YGHXZ)
test.obj : error LNK2001: 无法解析的外部符号 "struct hostent * __stdcall gethostbyaddr(char const *,int,int)" (?gethostbyaddr@@$$J212YGPAUhostent@@PBDHH@Z)
test.obj : error LNK2001: 无法解析的外部符号 "unsigned long __stdcall inet_addr(char const *)" (?inet_addr@@$$J14YGKPBD@Z)
test.obj : error LNK2001: 无法解析的外部符号 "struct hostent * __stdcall gethostbyname(char const *)" (?gethostbyname@@$$J14YGPAUhostent@@PBD@Z)
test.obj : error LNK2001: 无法解析的外部符号 "int __stdcall WSAStartup(unsigned short,struct WSAData *)" (?WSAStartup@@$$J18YGHGPAUWSAData@@@Z)
E:\zhuzi\test\Debug\test.exe : fatal error LNK1120: 12 个无法解析的外部命令
//////////////////////////////////////////////////////////////////////
说明:
我程序的开始我包含了:
#include <winsock2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
最后请高手给予帮助。
另:分不够可以在加!!!!