curl 编译和使用在win平台和可以直接使用的bin

本文详细介绍了如何在Windows平台上编译curl库,包括使用CMake和Visual Studio 2019,并提供了测试代码。同时,分享了直接使用预编译bin文件的来源和相关库的配置问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1编译 库方式.libcurl+winssl /libcurl+openssl/

一cmake : curl-7.69.0\CMake

二 vc: curl-7.69.0\projects

三Command Prompt:curl-7.69.0\winbuild

2.使用介绍:https://curl.haxx.se/libcurl/c/

3.vs2019测试代码

#include <curl/curl.h>    
#include<stdio.h>



#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "wldap32.lib")
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "advapi32.lib")
#pragma comment(lib, "libcurl_a.lib")
int main(int argc, char* argv[]) {
	CURL* curl = 0;
	CURLcode res;
	curl = curl_easy_init();
	if (curl != 0) {
		curl_easy_setopt(curl, CURLOPT_URL, "https://www.baidu.com");
		/* example.com is redirected, so we tell libcurl to follow redirection */
		curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
		/* Perform the request, res will get the return code */
		res = curl_easy_perform(curl);
		/* Check for errors */
		if (res != CURLE_OK) {
			fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
		}
		/* always cleanup */
		curl_easy_cleanup(curl);
	}

	return 0;
}

-----------------------------------------------------------

参考文献

1.https://blog.csdn.net/daso_csdn/article/details/77587916?utm_medium=distribute.pc_relevant.none-task-blog-title-2&spm=1001.2101.3001.4242

2.https://blog.csdn.net/hanxiucaolss/article/details/88952200

3.https://blog.csdn.net/qq_43680827/article/details/105380969

4.https://blog.csdn.net/mingpingzhang/article/details/38794269

-----------

5.https://blog.csdn.net/Esonpo/article/details/39319223?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control

6.https://www.cnblogs.com/chenyangchun/p/6868102.html

7.https://www.cnblogs.com/ytjjyy/archive/2012/05/19/2508803.html

8.https://www.pianshen.com/article/5238709511/

9.https://www.cnblogs.com/zzugyl/p/5037152.html

10.https://www.cnblogs.com/zzugyl/p/5037152.html

11.https://blog.csdn.net/lixiang987654321/article/details/81154613

12.https://blog.csdn.net/wojiaopanpan/article/details/106552937

---------------------

库相关问题介绍

1.https://www.cnblogs.com/zdf123/p/11290218.html

2.https://blog.csdn.net/xueyuan1024/article/details/82221109

--------------------------------------------------------------

直接使用bin 

1.https://windows.php.net/downloads/php-sdk/deps/vc15/x64/

2.https://blog.jjonline.cn/otherarticle/146.html

--------------------

使用库

https://blog.csdn.net/sunflover454/article/details/49030803

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值