Ok, I hate it when I run into a compile error and have to scour all over the Internet to find what libraries or defines are necessary, so I'm starting up this thread to paste my errors and what I've done to fix them.
Error:
Linking...
curltest1.obj : error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function _main
curltest1.obj : error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function _main
curltest1.obj : error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function _main
Debug/cURLTest.exe : fatal error LNK1120: 3 unresolved externals
Solution:
#define CURL_STATICLIB before including curl.h (or add CURL_STATICLIB to the preprocessor defines in the C/C++ section of the project properties in visual studio)
Error:
Linking...
curllib_mtd.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _win32_init
curllib_mtd.lib(telnet.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _printsub
curllib_mtd.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _win32_init
curllib_mtd.lib(telnet.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _printsub
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _ftp_state_use_port
curllib_mtd.lib(http.obj) : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _Curl_https_connecting
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__closesocket@4
curllib_mtd.lib(url.obj) : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _conn_free
curllib_mtd.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp__closesocket@4
curllib_mtd.lib(hostthre.obj) : error LNK2001: unresolved external symbol __imp__closesocket@4
curllib_mtd.lib(multi.obj) : error LNK2001: unresolved external symbol __imp__closesocket@4
curllib_mtd.lib(getinfo.obj) : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _Curl_getinfo
curllib_mtd.lib(sendf.obj) : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _curl_slist_append
curllib_mtd.lib(inet_ntop.obj) : error LNK2019: unresolved external symbol __imp__WSASetLastError@4 referenced in function _Curl_inet_ntop
curllib_mtd.lib(hostthre.obj) : error LNK2001: unresolved external symbol __imp__WSASetLastError@4
curllib_mtd.lib(inet_ntop.obj) : error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function _inet_ntop4
curllib_mtd.lib(hostthre.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _Curl_getaddrinfo
curllib_mtd.lib(telnet.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _printoption
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
curllib_mtd.lib(hostthre.obj) : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function _Curl_getaddrinfo
curllib_mtd.lib(hostthre.obj) : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function _Curl_getaddrinfo
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function _ftp_state_post_retr_size
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function _Curl_store_ip_addr
curllib_mtd.lib(hostthre.obj) : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _init_resolve_thread
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _ftp_state_mdtm_resp
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__socket@12
curllib_mtd.lib(hostip4.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _Curl_he2ai
curllib_mtd.lib(socks.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _Curl_SOCKS5
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _bindlocal
curllib_mtd.lib(sendf.obj) : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _Curl_plain_send
curllib_mtd.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__send@16
curllib_mtd.lib(timeval.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function _gettimeofday
curllib_mtd.lib(tftp.obj) : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _Curl_tftp_connect
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _ftp_state_post_retr_size
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__bind@12
curllib_mtd.lib(tftp.obj) : error LNK2019: unresolved external symbol __imp__recvfrom@24 referenced in function _Curl_tftp
curllib_mtd.lib(tftp.obj) : error LNK2019: unresolved external symbol __imp__sendto@24 referenced in function _tftp_send_first
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _ftp_state_use_port
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _ftp_state_use_port
curllib_mtd.lib(socks.obj) : error LNK2001: unresolved external symbol __imp__ntohs@4
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__ntohs@4
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__getsockname@12 referenced in function _ftp_state_use_port
curllib_mtd.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__getsockname@12
curllib_mtd.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _AllowServerConnect
curllib_mtd.lib(select.obj) : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _Curl_select
curllib_mtd.lib(select.obj) : error LNK2019: unresolved external symbol __imp__select@20 referenced in function _Curl_select
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function _Curl_nonblock
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function _verifyconnect
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function _singleipconnect
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function _tcpnodelay
curllib_mtd.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__getprotobyname@4 referenced in function _tcpnodelay
Debug/cURLTest.exe : fatal error LNK1120: 27 unresolved externals
Solution:
Add ws2_32.lib and winmm.lib to the additional dependencies in linker/input