一个让人头疼的简单问题!!(急,在线等)

zhang5765 zhang5765 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我在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>
最后请高手给予帮助。
另:分不够可以在加!!!!
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
zhang5765
通信技术 4,397 成员 28,909 内容