下载

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. c++中类长度解析

    通常我们定义一个类,它所占的空间有多大呢? 首先我们看一下下面的这个类 class A{ public: void func1(void){ printf("11111heihei\n&qu ...

  2. Jsp的三、七、九

    1.jsp的三个编译指令 <%page %> <%taglib %> <%include %> 2.jsp的七个动作指令 forward param include ...

  3. java中调用dll文件的两种方法

    一中是用JNA方法,另外是用JNative方法,两种都是转载来的, JNA地址:http://blog.csdn.net/shendl/article/details/3589676   JNativ ...

  4. Hooks——钩子概览

    (资料源于MSDN,本文仅对其进行翻译.批注.其链接为:http://msdn.microsoft.com/en-us/library/windows/desktop/ms644959%28v=vs. ...

  5. Codeforces Round #324 (Div. 2) A. Olesya and Rodion 水题

    A. Olesya and Rodion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/p ...

  6. CentOS安装Nginx安装详解

    一.准备工作,安装依赖包,缺一不可!(推荐先用命令查看自己是否已经安装一下软件,确认没有再安装) --------------------------------------------------- ...

  7. UVA - 10883 Supermean

    Description Problem F Supermean Time Limit: 2 second "I have not failed. I've just found 10,000 ...

  8. ajax表单提交插件jquery.form.js的运用

    该插件提交的数据包含上传的图片. 1.先导入jquery.form.js 2.form表单的元素: <form id="form2_form" method="po ...

  9. 解决Windows2008Server上PLSQL登录时报ORA-12557

    公司的Oracle服务端是安装在一台Linux服务器上,版本号为11.1.0.7.0.我们开发的系统部署在Windows 2008 Server(x64),因为偶尔需要调用Oracle数据库,所以最开 ...

  10. GWT 中日期格式化 ,处置Date

    GWT的view中不能用java原生的DateFormat 必须使用gwt封装的格式化方法,方法如下 import com.google.gwt.i18n.client.DateTimeFormat; ...