我需要使用libcurl的静态库,我发现生成该库的this github rep

现在,我正在尝试使用静态库libcurl_a.lib编译使用curl的简单代码,但是没有成功。

首先,我错过了-DCURL_STATICLIB标志,并且得到了一些未定义的引用错误:

undefined reference to `curl_easy_init'
undefined reference to `curl_easy_setopt'
undefined reference to `curl_easy_setopt'
undefined reference to `curl_easy_perform'
undefined reference to `curl_easy_strerror'
undefined reference to `curl_easy_cleanup'

标志解决了它,但是现在我得到了这些:
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll referenced in function _Curl_ftp_parselist
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__GetTickCount64@0 referenced in function _curlx_tvnow
unresolved external symbol __imp__InitializeCriticalSectionEx@12 referenced in function _init_thread_sync_data
unresolved external symbol __ltod3 referenced in function _getinfo_double
unresolved external symbol __ltod3
unresolved external symbol __dtol3 referenced in function _Curl_pgrsUpdate
unresolved external symbol ___report_rangecheckfailure referenced in function _base64_encode

我被困在这里,不知道如何解决这个未解决的外部符号。

有人可以帮助我吗?谢谢

最佳答案

可能是您针对错误版本的kernel32.lib链接。您是否制作x64版本?
如果是这样,则需要更正您的库路径。

关于c++ - 编译Curl Visual Studio-无法解析的外部符号,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30949090/

10-12 01:46