zoukankan      html  css  js  c++  java
  • Linux下编译LibCURL

    编译环境
    操作系统: Red Hat Enterprise Linux Server release 5.4 64-bit
    编译工具: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
     
     
    1.    下载libssh2库
     
    将libssh2-1.4.2.tar.gz上传至/home目录下
     
     
    2.    编译安装libssh2库
     
    $ cd /home
    $ tar -zxvf libssh2-1.4.2.tar.gz
    $ cd libssh2-1.4.2
    $ ./configure --with-libssl-prefix=/usr/local/openssl
    $ make && make install && make clean
     
    注:如果出现:configure: error: cannot find OpenSSL or Libgcrypt 错误
     
    修改为:./configure --with-libssl-prefix=/usr/local/openssl CPPFLAGS="-I/usr/local/openssl/include" LDFLAGS="-L/usr/local/openssl/lib"
     
     
    3.    下载LibCURL
     
    地址:http://curl.haxx.se/download.html
    以curl-7.27.0.tar.gz包为例,将curl-7.27.0.tar.gz上传至/home目录下
     
     
    4.     解压LibCURL
     
    $ cd /home
    $ tar -zxvf curl-7.27.0.tar.gz
    $ cd curl-7.27.0
     
     
    5.    编译并安装
     
    编译
    $ ./configure --with-ssl=/usr/local/openssl --with-libssh2=/usr/local --with-zlib
    $ make && make install
     
    清理编译时的中间文件
    $ make clean
     
     
    6.    使用
     
    在/usr/local/lib中存放的生成的LibCURL库libcurl.a,可以直接用来参与静态编译





  • 相关阅读:
    HTML 5 全局属性
    微软build 2015
    写个程序登陆58同城
    工厂方法
    简单工厂
    System.Data.SQLite兼容32位和64位问题
    利用Socket实现的两个程序的通信
    最近的工作总结
    Canvas路径、描边、填充
    HTML5阴影与渐变
  • 原文地址:https://www.cnblogs.com/jeffen/p/5994021.html
Copyright © 2011-2022 走看看