vc++2010 error LNK2019错误
来源:互联网 发布:淘宝的心怎么快速升级 编辑:程序博客网 时间:2024/05/16 16:18
学习vc++深入详解(孙鑫,余安萍著)中tcp协议编写时,编译错误:提示
error LNK2019LNK2019: 无法解析的外部符号 __imp__closesocket@4,该符号在函数 _wmain 中被引用
经过google查询, 在http://blog.sina.com.cn/s/blog_684c0acc0100icxy.html找到解决方案,必须在项目->属性(alt f7)->配置属性->Linker->Commond Line 中附加选项加入ws2_32.lib。
测试后问题解决。
附上原文:
错误:
------ 已启动生成: 项目: TCPSrv, 配置: Debug Win32 ------
正在链接...
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__closesocket@4,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__recv@16,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__send@16,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__inet_ntoa@4,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__accept@12,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__listen@8,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__bind@12,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__htons@4,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__htonl@4,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__socket@12,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__WSACleanup@0,该符号在函数 _wmain 中被引用
TCPSrv.obj : error LNK2019: 无法解析的外部符号 __imp__WSAStartup@8,该符号在函数 _wmain 中被引用
D:/C++/TCPSrv/Debug/TCPSrv.exe : fatal error LNK1120: 12 个无法解析的外部命令
生成日志保存在“file://d:/C++/TCPSrv/TCPSrv/Debug/BuildLog.htm”
TCPSrv - 13 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
解决办法:如果是用的vc2003以上的版本,你必须在工程设置属性当中Linker->Commond Line 中附加选项加入ws2_32.lib
- vc++2010 error LNK2019错误
- vc++2010 error LNK2019错误
- 碰到一个错误 error LNK2019
- 编译jsoncpp错误:error LNK2019
- VC++常规错误之一:error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常规错误之一:error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常规错误之一:error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常规错误之一:error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- 【原创】error LNK2019: error LNK2001 错误
- VS2015 VC报错 error LNK2019
- vc编译链接错误--LNK2001,LNK2019
- [转]vc编译链接错误--LNK2001,LNK2019,
- mfc菜单
- NumPy使用手记
- Objective-C基础教程读书笔记(7)
- Data Pump体系结构
- Create a Java Web Application using Embedded Tomcat (如何使用Embedded 创建一个基于Tomcat的Web 应用))
- vc++2010 error LNK2019错误
- Collections.sort升序和降序笔记
- Sql Server 2008批量导入表、视图的脚本
- 黑马程序员-类加载器
- 读书笔记-剑指offer面试题4
- Android 输入法遮挡问题
- Android Binder之经典好文
- 最长重复子串
- Ecliplse 指定JRE