孟晓艺微博怎么没了:vc++编译成功但link.exe 时出错是怎么回事?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/05 23:37:27
组建时信息如下:

--------------------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 LNK2001: unresolved external symbol _list_free
main.obj : error LNK2001: unresolved external symbol _free_pointer
main.obj : error LNK2001: unresolved external symbol _my_ntoa
main.obj : error LNK2001: unresolved external symbol _listen@8
main.obj : error LNK2001: unresolved external symbol _bind_interface
main.obj : error LNK2001: unresolved external symbol _new_tcp_socket
main.obj : error LNK2001: unresolved external symbol _list_count
main.obj : error LNK2001: unresolved external symbol _lookup_ip
main.obj : error LNK2001: unresolved external symbol _init_server
main.obj : error LNK2001: unresolved external symbol _inet_addr@4
main.obj : error LNK2001: unresolved external symbol _optarg
main.obj : error LNK2001: unresolved external symbol __getopt
main.obj : error LNK2001: unresolved external symbol _remove_connection
main.obj : error LNK2001: unresolved external symbol _send_queued_data
main.obj : error LNK2001: unresolved external symbol _handle_connection
main.obj : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
main.obj : error LNK2001: unresolved external symbol _set_keepalive
main.obj : error LNK2001: unresolved external symbol _set_nonblocking
main.obj : error LNK2001: unresolved external symbol _add_client
main.obj : error LNK2001: unresolved external symbol _ntohs@4
main.obj : error LNK2001: unresolved external symbol _new_connection
main.obj : error LNK2001: unresolved external symbol _inet_ntoa@4
main.obj : error LNK2001: unresolved external symbol _accept@12
Debug/5.exe : fatal error LNK1120: 35 unresolved externals
执行 link.exe 时出错.

5.exe - 1 error(s), 0 warning(s)

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

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