CURL静态链接未解析的外部符号 [英] CURL Static Link Unresolved External Symbols
问题描述
我使用x64本机工具命令提示符Visual Studio中的命令从源代码构建了CURL静态库
I built CURL static lib from source using this command in the x64 Native Tools Command Prompt Visual Studio
nmake/f Makefile.vc mode = static MACHINE = AMD64
nmake /f Makefile.vc mode=static MACHINE=AMD64
我将lib文件夹添加到链接器库文件夹,将libcurl_a.lib添加到链接器输入,并将include文件夹添加到其他include目录.我还使用了预处理器定义CURL_STATICLIB.
I added the lib folder to the linker library folder, added libcurl_a.lib to the linker input, and added the include folder to additional include directories. I also used the pre-processor define CURL_STATICLIB.
库成功链接,并且找到了标题.但是,当我尝试编译时,会得到60个无法解析的外部符号. https://hastebin.com/vukekakoti.tex
The library links successfully and the header is found. But I get 60 unresolved external symbols when I try to compile. https://hastebin.com/vukekakoti.tex
动态链接没有任何问题.
Dynamic linking is working with no problems.
我该如何解决?
推荐答案
我缺少这些库中包含的定义:
I was missing definitions contained in these libraries:
libcurl_a.lib; ws2_32.lib; wldap32.lib; advapi32.lib; kernel32.lib; comdlg32.lib; crypt32.lib; normaliz.lib
libcurl_a.lib;ws2_32.lib;wldap32.lib;advapi32.lib;kernel32.lib;comdlg32.lib;crypt32.lib;normaliz.lib
将那些添加到您的其他依赖项中.
Add those to your additional dependencies.
这篇关于CURL静态链接未解析的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!