我在程序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.
解决方法:
[Project->
Setting]-> [Link-> Object/Library modules]加入wsock32.lib
分享到:
相关推荐
### [Linker Error] Unresolved External 问题的解决方法 在软件开发过程中,尤其是在使用编译器进行项目构建时,可能会遇到“未解析外部符号”(Unresolved External)的链接错误。这类错误通常出现在编译完成后,...
有具体的help说明,并有vs2005/vs2008/vs2010添加.lib文件的方法以及vc2005出错解决方法error LNK2019: unresolved external symbol __imp____glutInitWithExit@12 referenced in function _glutInit_ATEXIT_HACK@8
- `libsvn_subr-1.lib(config_win.obj):error LNK2001: unresolved external symbol __imp__SHGetFolderPathW@20` - `Debug/mini_client.exe: fatal error LNK1120: 2 unresolved externals` 这些问题通常是由于...
7. **Release模式编译错误**:如果网络程序在Debug模式下运行正常,但在Release模式下报错`error LNK2001: unresolved external symbol __imp__WSAStartup@8`,需在Release配置中添加Ws2_32.lib库。 8. **窗口重绘...
有时候,当你尝试在Release模式下编译一个包含网络编程的程序时,可能会遇到`error LNK2001: unresolved external symbol __imp__WSAStartup`这样的链接错误。这通常是由于缺少必要的库文件导致的。为了解决这个问题...