vc++编译成功但link.exe 时出错是怎么回事?

来源:百度知道 编辑:UC知道 时间:2024/05/29 01:33:33
组建时信息如下:

--------------------Configuration: 5 - Win32 Debug--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol _WSACleanup@0
main.obj : error LNK2001: unresolved external symbol _closesocket@4
main.obj : error LNK2001: unresolved external symbol _exec_timers
main.obj : error LNK2001: unresolved external symbol _WSAGetLastError@0
main.obj : error LNK2001: unresolved external symbol _select@20
main.obj : error LNK2001: unresolved external symbol _next_timer
main.obj : error LNK2001: unresolved external symbol _note_mass_notification
main.obj : error LNK2001: unresolved external symbol _note_dump
main.obj : error LNK2001: unresolved external symbol _chandb_dump
main.obj : error LNK2001: unresolved external symbol _add_timer
main.obj : error LNK2001: unresolved external symbol _WSAStartup@8
main.obj : error LNK2001: unresolved external symbol _Channel_Db
main.obj : error LNK200

没有把需要的LIB文件加到链接列表里. 这里看来是网络方面的库.

-- 链接列表在VC的项目属性里的链接选项里, 把需要的LIB文件都填到那个"输入"框框里.
-- 看看环境设置里, LIB文件夹的路径是否已经包含了VC的库文件所有的路径?
-- 少哪个LIB? 你可在MSDN LIB里查一下, 比台WSACleanup()这个函数, 看看说是哪个LIB文件.