今天看VC 网络编程,似乎很简单,依样画了个聊天室的葫芦,结果,结果惨不忍睹:
--------------------Configuration: example1 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Client.cpp
example1.cpp
example1Dlg.cpp
Server.cpp
Generating Code...
Linking...
Client.obj : error LNK2001: unresolved external symbol _connect@12
Client.obj : error LNK2001: unresolved external symbol _htons@4
Server.obj : error LNK2001: unresolved external symbol _htons@4
Client.obj : error LNK2001: unresolved external symbol _inet_addr@4
Client.obj : error LNK2001: unresolved external symbol _socket@12
Server.obj : error LNK2001: unresolved external symbol _socket@12
Client.obj : error LNK2001: unresolved external symbol _closesocket@4
example1Dlg.obj : error LNK2001: unresolved external symbol _closesocket@4
Server.obj : error LNK2001: unresolved external symbol _closesocket@4
Client.obj : error LNK2001: unresolved external symbol _send@16
example1Dlg.obj : error LNK2001: unresolved external symbol _send@16
Client.obj : error LNK2001: unresolved external symbol _recv@16
example1Dlg.obj : error LNK2001: unresolved external symbol _recv@16
Client.obj : error LNK2001: unresolved external symbol _WSAAsyncSelect@16
Server.obj : error LNK2001: unresolved external symbol _WSAAsyncSelect@16
example1Dlg.obj : error LNK2001: unresolved external symbol _WSAStartup@8
example1Dlg.obj : error LNK2001: unresolved external symbol _accept@12
Server.obj : error LNK2001: unresolved external symbol _listen@8
Server.obj : error LNK2001: unresolved external symbol _bind@12
Debug/example1.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
Creating browse info file...
example1.exe - 20 error(s), 0 warning(s)
后来google到http://boyeestudio.cnblogs.com/archive/2005/12/10/294539.html,才知道是WSOCK32.LIB威力无边,
得劳驾我们在工程设置里 说一下。
兹证明学网络得先学VC~~