error LNK2001:unresolved external symbol __imp__@ 解决方法
2012-05-06 15:06 java20130722 阅读(1389) 评论(0) 编辑 收藏 举报我在程序Lan中使用了winsock函数,出现如下错误:
Lan.obj:error LNK2001: unresolved external symbol __imp__listen@8
Lan.obj : error LNK2001: unresolved external symbol __imp__bind@12
Lan.obj : error LNK2001: unresolved external symbol __imp__setsockopt@20
Lan.obj : error LNK2001: unresolved external symbol __imp__htons@4
Lan.obj : error LNK2001: unresolved external symbol __imp__WSAAsyncSelect@16
Lan.obj : error LNK2001: unresolved external symbol __imp__socket@12
Lan.obj : error LNK2001: unresolved external symbol __imp__connect@12
Lan.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
Lan.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
Lan.obj : error LNK2001: unresolved external symbol __imp__accept@12
Lan.obj : error LNK2001: unresolved external symbol __imp__gethostname@8
Lan.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
Debug/Transport.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
Lan.obj:error LNK2001: unresolved external symbol __imp__listen@8
Lan.obj : error LNK2001: unresolved external symbol __imp__bind@12
Lan.obj : error LNK2001: unresolved external symbol __imp__setsockopt@20
Lan.obj : error LNK2001: unresolved external symbol __imp__htons@4
Lan.obj : error LNK2001: unresolved external symbol __imp__WSAAsyncSelect@16
Lan.obj : error LNK2001: unresolved external symbol __imp__socket@12
Lan.obj : error LNK2001: unresolved external symbol __imp__connect@12
Lan.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
Lan.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
Lan.obj : error LNK2001: unresolved external symbol __imp__accept@12
Lan.obj : error LNK2001: unresolved external symbol __imp__gethostname@8
Lan.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
Debug/Transport.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
解决方法:
[Project->
Setting]-> [Link-> Object/Library modules]加入wsock32.lib
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步