LNK2019:常见缺的两个系统库文件

在开发过程中遇到了一系列与ws2_32.lib、winmm.lib和gdi32.lib相关的链接错误,如无法解析的外部符号。这些问题通常涉及到WindowsAPI函数未正确链接。解决方案可能包括确保正确包含库文件,设置链接器选项,或者在源代码中正确声明和实现这些函数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ws2_32.lib

error LNK2001: 无法解析的外部符号 __imp_htons

error LNK2001: 无法解析的外部符号 __imp_ntohl

error LNK2001: 无法解析的外部符号 __imp_ntohs

error LNK2019: 无法解析的外部符号 in6addr_any

error LNK2001: 无法解析的外部符号 __imp_htonl

error LNK2019: 无法解析的外部符号 in6addr_loopback

winmm.lib

error LNK2019: 无法解析的外部符号 __imp_timeKillEvent

error LNK2019: 无法解析的外部符号 __imp_timeBeginPeriod

error LNK2019: 无法解析的外部符号 __imp_timeEndPeriod

error LNK2019: 无法解析的外部符号 __imp_timeSetEvent

error LNK2019: 无法解析的外部符号 __imp_timeGetTime

gdi32.lib

error LNK2019: 无法解析的外部符号 __imp_CreateRectRgn

error LNK2019: 无法解析的外部符号 __imp_GetRgnBox

error LNK2019: 无法解析的外部符号 __imp_DeleteObject

error LNK2001: 无法解析的外部符号 __imp_DeleteObject

error LNK2019: 无法解析的外部符号 __imp_GetCurrentObject

error LNK2019: 无法解析的外部符号 __imp_GetObjectW

error LNK2019: 无法解析的外部符号 __imp_CreateCompatibleDC

error LNK2001: 无法解析的外部符号 __imp_CreateCompatibleDC

error LNK2019: 无法解析的外部符号 __imp_SelectObject

error LNK2001: 无法解析的外部符号 __imp_SelectObject

error LNK2019: 无法解析的外部符号 __imp_BitBlt

error LNK2001: 无法解析的外部符号 __imp_BitBlt

error LNK2019: 无法解析的外部符号 __imp_DeleteDC

error LNK2001: 无法解析的外部符号 __imp_DeleteDC

error LNK2019: 无法解析的外部符号 __imp_GetDeviceCaps

error LNK2001: 无法解析的外部符号 __imp_GetDeviceCaps

error LNK2001: 无法解析的外部符号 __imp_GetDeviceCaps

error LNK2019: 无法解析的外部符号 __imp_CreateDIBSection

更多请参考:

链接:https://www.jianshu.com/p/3fd9f84b5de8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值