下载

curl的官网:https://curl.haxx.se/

libcurl就是一个库,curl就是使用libcurl实现的。

curl是一个exe,也可以说是整个项目的名字,而libcurl就是一个独立的库,所以做二次开发一般就使用库,当然为了简单也可以直接用curl.exe来完成。

curl只提供了源码的方式:https://curl.haxx.se/download.html,其他的方式都是第三方自己编译发布的。

curl下载安装的方式参考:https://curl.haxx.se/dlwiz/

curl executable - You will get a pre-built 'curl' binary from this link (or in some cases, by using the information that is provided at the page this link takes you). You may or may not get 'libcurl' installed as a shared library/DLL.

libcurl development - This is for libcurl development - but does not always contain libcurl itself. Most likely header files and documentation. If you intend to compile or build something that uses libcurl, this is most likely the package you want.

libcurl - This is a pure binary libcurl package, possibly including header files and documentation, but without the command line tool and other cruft. If you want libcurl for a program that uses libcurl, this is most likely the package you want.

source code - You will not download a pre-built binary from this link. You will instead get a link to site with the curl source, adjusted for your platform. You will need to have a compiler setup and working to be able to build curl from a source package.

Show All - Display all known package types.

这里的下载方式多数也是其他商家提供的,除了源码和可执行程序以外。

比如libcurl dev就没有windows平台的。

比如libcurl就是cygwin提供的,所以他的库也是用于cygwin的。

而sourcecode就可以下载平台独立的包,但是不是最新的。所以直接在https://curl.haxx.se/download.html页面下载即可。

下面就是主页下载的图片:

我们就下载zip版本:

官方资料

https://curl.haxx.se/libcurl/c/

https://curl.haxx.se/libcurl/c/libcurl-tutorial.html

其他的HTTPClient

libcurl (MIT)

    a highly portable and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunnelling and more!

libghttp (LGPL)

    Having a glance at libghttp (a gnome http library), it looks as if it works rather similar to libcurl (for http). There's no web page for this and the person who's email is mentioned in the README of the latest release I found claims he has passed the leadership of the project to "eazel". Popular choice among GNOME projects.

libwww (W3C license) comparison with libcurl

    More complex and harder to use than libcurl is. Includes everything from multi-threading to HTML parsing. The most notable transfer-related feature that libcurl does not offer but libwww does, is caching.

libferit (GPL)

      C++ library "for transferring files via http, ftp, gopher, proxy server". Based on 'snarf' 2.0.9-code (formerly known as libsnarf). Quote from freshmeat:

"As the author of snarf, I have to say this frightens me. Snarf's networking system is far from robust and complete. It's probably full of bugs, and although it works for maybe 85% of all current situations, I wouldn't base a library on it."

neon (LGPL) comparison with neon

    An HTTP and WebDAV client library, with a C interface. I've mainly heard and seen people use this with WebDAV as their main interest. This is one of the two alternatives used by the Subversion project.

libsoup (LGPL) comparison with libcurl

    Part of glib (GNOME). Supports: HTTP 1.1, Persistent connections, Asynchronous DNS and transfers, Connection cache, Redirects, Basic, Digest, NTLM authentication, SSL with GnuTLS, Proxy support including SSL, POST data. Not portable. Lacks: cookie support, NTLM for proxies, GSS, gzip encoding, trailers in chunked responses, portability and more.

mozilla netlib (MPL)

    Handles URLs, protocols, transports for the Mozilla browser.

mozilla libxpnet (MPL)

    Minimal download library targeted to be much smaller than the above mentioned netlib. HTTP and FTP support.

wget (GPL)

    While not a library at all, I've been told that people sometimes extract the network code from it and base their own hacks from there.

libfetch (BSD)

      Does HTTP and FTP transfers (both ways), supports file: URLs, and an API for URL parsing. The utility

fetch

      that is built on libfetch is an integral part of the

FreeBSD

    operating system.

HTTP Fetcher (LGPL)

      "

a small, robust, flexible library for downloading files via HTTP using the GET method.

    "

http-tiny (Artistic License)

      "

a very small C library to make http queries (GET, HEAD, PUT, DELETE, etc.) easily portable and embeddable

    "

wininet comparison with libcurl

"The Windows Internet (WinINet) application programming interface (API) enables applications to interact with Gopher, FTP, and HTTP protocols to access Internet resources."

XMLHTTP Object also known as IXMLHTTPRequest (part of MSXML 3.0)

    (Windows) Provides client-side protocol support for communication with HTTP servers. A client computer can use the XMLHTTP object to send an arbitrary HTTP request, receive the response, and have the Microsoft® XML Document Object Model (DOM) parse that response.

QHttp (GPL)

    QHttp is a class in the Qt library from Troll Tech. Seems to be restricted to plain HTTP. Supports GET, POST and proxy. Asynchronous.

ftplib (GPL)

      "

a set of routines that implement the FTP protocol. They allow applications to create and access remote files through function calls instead of needing to fork and exec an interactive ftp client program."

      I stopped using it because it did not evolve and the maintainer did not even answer to my e-mailed patches and forum posts. The web site seems abandoned and the forum is not reachable anymore. It is simpler to use than libcurl, because it is not based on callbacks. But is is also much less powerful. /

Patrick

ftplib++ (GPL)

    A C++ library for "easy FTP client functionality. It features resuming of up- and downloads, FXP support, SSL/TLS encryption, and logging functionality."

GNU Common C++ library

    Has a URLStream class. This C++ class allow you to download a file using HTTP. See demo/urlfetch.cpp in commoncpp2-1.3.19.tar.gz

HTTPClient (LGPL)

    Java HTTP client library.

Jakarta Commons HttpClient (Apache License)

    A Java HTTP client library written by the Jakarta project.

gnetlibrary (LGPL)

"a simple network library. It is written in C, object-oriented, and built upon GLib. It is intended to be easy to use and port"

    . Features a HTTP component. It uses glib, and integrates very well within Gtk+ applications, which require event-driven programming.

Serf (Apache License)

"The serf library is a C-based HTTP client library built upon the Apache Portable Runtime (APR) library. It multiplexes connections, running the read/write communication asynchronously."

    This is one of the two alternatives used by the Subversion project.

qDecoder (BSD)

      qDecoder is a development kit for C/C++ network programming includes simple

HTTP client API

    .

编译

在curl的官方文档里面没有看到readme有讲解怎么使用,编译,安装等。但是肯目录结构也能猜出来...

就是在projects下面就有使用IDE编译的说明。还有一种编译方式,直接用命令的方式,参考:curl-7.50.1\winbuild

1.先用generate.bat生成项目文件

2.下载依赖库

下载的依赖库最好都应该放到同一个目录,跟curl是同一级的目录

1)    activeperl

下载地址:http://www.activestate.com/activeperl/downloads

2)    openssl

“openssl/ssl.h”: No such file or directory

https://www.openssl.org/source/

参考文件:INSTALL.W32

1.配置:openssl-1.0.2h>perl Configure VC-WIN32 --prefix=E:\openssl (我们不需要汇编asm,所以不用这个方案)

perl Configure VC-WIN32 no-asm --prefix=E:/openssl/

2.ms\do_nasm(我们不需要汇编asm,所以不用这个方案)

ms\do_ms

3.换用vs的命令行工具,切换到根目录,然后,输入:nmake -f ms\ntdll.mak

错误:

cryptlib.obj : error LNK2001: 无法解析的外部符号 _OPENSSL_ia32cap_P

cryptlib.obj : error LNK2019: 无法解析的外部符号 _OPENSSL_ia32_cpuid,该符号在函数 _OPENSSL_cpuid_setup 中被引用

这个错误的原因是之前编译的临时文件没有清理的问题,因为我之前编译的时候没有添加no-asm选项,后面加上时没有清理就直接编译了,那肯定有问题。

所以重新清理下再编译即可(清理方式就是重新解压一份原来的压缩包,重新来就是了)

4.测试

nmake -f ms\ntdll.mak test

5.安装

nmake -f ms\ntdll.mak install

安装完成之后就是如下目录:

3)    Zlib

http://zlib.net/

http://zlib.net/zlib128.zip

zlib需要用makefile(zlib128\zlib-1.2.8\win32)编译(或者用VS也可以:zlib128\zlib-1.2.8\contrib\vstudio\vc10)

用makefile就需要启动VS的命令提示符来进行编译:

切换到zlib目录,然后输入nmake -f win32/Makefile.msc

下面是编译完成之后的截图:

4)    libssh2

下载地址:https://www.libssh2.org/download/libssh2-1.7.0.tar.gz

打开:libssh2-1.7.0\win32\libssh2.dsw

5)    pthread

ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip

这是一家编译好的版本,直接用就是了

3.使用VS编译Curl

在project下面,根据自己的VS版本类型,选择对应的目录进去即可。

1)    配置libcurl依赖库的头文件路径

2)    配置libcurl库的lib路径

3)    修改依赖的库

由于我们的VS环境可能已经配置了其他的默认的一些库,所以这里编译就可能导致依赖的不相关的库找不到。

于是我们就不从父级继承,而是直接把kernel32.lib和user32.lib添加上即可

4)    生成libcurl

5)    同样,修改curl的lib

6)    生成curl

头文件路径

curl-7.50.1\include

Curl的编译的更多相关文章

  1. curl+openssl编译

    curl不支持openssl的静态库,所以编译openssl的时候,应该加上shared 参数,记录一下我亲手编译的参数: ./configure --prefix=/usr/local/openss ...

  2. lua curl动态链接库编译安装

    关于lua curl的资料网上并不是很多.找来找去就那么几个,所以我绝得很有必要把我的经验记下来,以防下次忘记                                              ...

  3. lua curl动态链接库编译安装(二)

    下面再介绍一下lua-curl中的lua-curl-0.2.tar.gz版本的安装方法,可能对于一般的人来说这个很简单,但是对于我们这些菜鸟来说就不一样了: # wget http://files.l ...

  4. 嵌入式 Linux下编译并使用curl静态库

    #x86 ./configure --disable-shared --enable-static --disable-ftp --disable-ipv6 --disable-rtsp --disa ...

  5. centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展

    centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...

  6. 解决PHP编译cURL的reinstall the libcurl问题

    今天正好要用到PHP的curl功能,发现服务器上的PHP并没有配置curl,进而查询PHP官方文档,得知编译PHP时需要带上 –with-curl参数,才能把curl模块编译进去.我现在PHP已经编译 ...

  7. Curl的移植编译以及注意事项

    最近需要用curl来发送http请求,遇到了不少问题,查了不少资料,都是零零散散的,现在总结下.   1.移植编译 ./configure --prefix=$(PWD)/build --host=a ...

  8. [转][linux][centos]嵌入式 Linux下编译并使用curl静态库

    #x86 ./configure --disable-shared --enable-static --disable-ftp --disable-ipv6 --disable-rtsp --disa ...

  9. php 未配置curl

    用到PHP的curl功能,发现服务器上的PHP并没有配置curl,进而查询PHP官方文档,得知编译PHP时需要带上 –with-curl参数,才能把curl模块编译进去.我现在PHP已经编译安装进服务 ...

随机推荐

  1. .NET/C# 类构造函数中this的用法 (转)

    在C#中this用来指代当前对象,用于当成员函数中的形参名跟成员变量名一致时,进行区分. 但this不仅仅只有这一作用,this还可以如下这样用: class class1 { private int ...

  2. 1.(1)编写一个接口ShapePara,要求: 接口中的方法: double getArea():获得图形的面积。double getCircumference():获得图形的周长 (2)编写一个圆类Circle,要求:圆类Circle实现接口ShapePara。 该类包含有成员变量: radius:public 修饰的double类型radius,表示圆的半径。 x:private修饰的dou

    package jiekou1; public interface ShapePara { //定义常量PI final double PI=3.14; //定义抽象方法 //获得图形面积 doubl ...

  3. Notes(一)

    Numerous experimental measurements in spatially complex systems have revealed anomalous diffusion in ...

  4. UITableview 中获取非选中的cell

    实现效果如图: 在cell中有一个button,选中cell改变button的选择状态 yes,选中另外一个cell,别的cell中的button选择状态变成false. //获取当前可显示的cell ...

  5. Codeforces Round #319 (Div. 1) C. Points on Plane 分块

    C. Points on Plane Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/576/pro ...

  6. VPN介绍--虚拟网络

      VPN属于远程访问技术,简单地说就是利用公网链路架设私有网络.例如 公司员工出差到外地,他想访问企 原理 业内网的 服务器资源,这种访问就属于远程访问.怎么才能让外地员工访问到内网资源呢?VPN的 ...

  7. Linux开发环境搭建与使用——ubuntu更新设置

    ubuntu操作系统公布时,为了减小操作系统的体积,只配备了主要的系统软件.应用软件.我们开发中须要用到的大部分软件都须要在使用中从网上自行更新. 假设ubuntu没有网络,能够说寸步难行. 以下教大 ...

  8. ios十进制、十六进制字符串,byte,data等之间的转换

    十进制->十六进制 Byte bytes[]={0xA6,0x27,0x0A}; NSString *strIdL  = [NSStringstringWithFormat:@"%@& ...

  9. Android手机上判断网络运营商

    我们想获取手机的运营商信息.通常都会去调用系统的TelephonyManager类的取数据.但是很多时候可能取不到卡的信息(例如双卡手机和 一些特殊卡),这样就区别不了运营商了.但是有时候我们的需求要 ...

  10. 标准I/O库之流和FILE对象

    对于标准I/O库,它们的操作是围绕流(stream)进行的.当用标准I/O库打开或创建一个文件时,我们已使一个流与一个文件相关联. 对于ASCII字符集,一个字符用一个字节表示.对于国际字符集,一个字 ...