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

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

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_p
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值