如题 编译成功 但是链接出现很多 如此的问题
所有的涉及到socket的操作都会出现这样的问题
请问改怎么办??急等 谢谢Compiling...
mtest.cpp
Linking...
mtest.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
mtest.obj : error LNK2001: unresolved external symbol __imp__shutdown@8
mtest.obj : error LNK2001: unresolved external symbol __imp__listen@8
mtest.obj : error LNK2001: unresolved external symbol __imp__bind@12
mtest.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
mtest.obj : error LNK2001: unresolved external symbol __imp__socket@12
mtest.obj : error LNK2001: unresolved external symbol __imp__htonl@4
mtest.obj : error LNK2001: unresolved external symbol __imp__htons@4
mtest.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
mtest.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
mtest.obj : error LNK2001: unresolved external symbol __imp__recv@16
mtest.obj : error LNK2001: unresolved external symbol __imp__accept@12
Debug/mtest.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.mtest.exe - 13 error(s), 0 warning(s)
所有的涉及到socket的操作都会出现这样的问题
请问改怎么办??急等 谢谢Compiling...
mtest.cpp
Linking...
mtest.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
mtest.obj : error LNK2001: unresolved external symbol __imp__shutdown@8
mtest.obj : error LNK2001: unresolved external symbol __imp__listen@8
mtest.obj : error LNK2001: unresolved external symbol __imp__bind@12
mtest.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
mtest.obj : error LNK2001: unresolved external symbol __imp__socket@12
mtest.obj : error LNK2001: unresolved external symbol __imp__htonl@4
mtest.obj : error LNK2001: unresolved external symbol __imp__htons@4
mtest.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
mtest.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
mtest.obj : error LNK2001: unresolved external symbol __imp__recv@16
mtest.obj : error LNK2001: unresolved external symbol __imp__accept@12
Debug/mtest.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.mtest.exe - 13 error(s), 0 warning(s)
::LoadLibrary("Ws2_32.lib");添加后运行没有错误,
但是上述几个问题仍然存在
请问应该怎样添加?
谢了!
加入
#pragma comment( lib, "ws2_32.lib" )or
project--setting--link--library/module填入 ws2_32.lib