vs2022 配置使用libcurl

[复制链接]
发表于 2023-3-7 15:46:43 | 显示全部楼层 |阅读模式
1、官网下载libcurl 
https://curl.se/download/curl-7.88.1.tar.gz
2、解压执行curl目录下的buildconf.bat,然后cd winbuild
3、编译windows下编译(MT):
32-debug: nmake /f Makefile.vc mode=static vc=10 debug=yes rtlibcfg=static machine=x32 ENABLE_IDN=no
32-release: nmake /f Makefile.vc mode=static vc=10 debug=no rtlibcfg=static machine=x32 ENABLE_IDN=no
64-debug: nmake /f Makefile.vc mode=static vc=10 debug=yes rtlibcfg=static machine=X64 ENABLE_IDN=no
64-release: nmake /f Makefile.vc mode=static vc=10 debug=no rtlibcfg=static machine=X64 ENABLE_IDN=no
windows下编译(MD):
32-debug: nmake /f Makefile.vc mode=static vc=10debug=yes machine=x32 ENABLE_IDN=no
32-release: nmake /f Makefile.vc mode=static vc=10debug=no machine=x32 ENABLE_IDN=no
64-debug: nmake /f Makefile.vc mode=static vc=10debug=yes machine=X64 ENABLE_IDN=no
64-release: nmake /f Makefile.vc mode=static vc=10debug=no machine=X64  ENABLE_IDN=no
重点是一定要加ENABLE_IDN=no,默认是打开的,不加的话编译会出错
X64不行就换AMD64
Boost安装64位的
1.  从boost官网(www.boost.org)下载boost库,已经更新到1.62.0,下载boost_1_62_0.zip并解压到指定的路径(我选择的路径是E:oost)。
2.  从开始->所有程序->Microsoft Visual Studio 2010,打开Visual Studio Tools的Visual Studio x64 Win64命令提示。
3.  切换到解压路径E:oostoost_1_62_0下,运行bootstrap.bat,建立编译工具bjam.exe,b2.exe。
4. b2 --toolset=msvc-10.0 --build-type=complete link=static address-model=64 threading=multi variant=release
 
 
注意vs release版本就写 debug=no,vs mt 编译需要加 rtlibcfg=static 参数
 
4、vs 设置包含库和目录

 
5、因为libcurl是静态编译的所以要加预处理器定义 CURL_STATICLIB

 
 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
继续阅读请点击广告

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

×
登录参与点评抽奖,加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表