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,可以直接用来参与静态编译





  • 相关阅读:
    加载器学习记录
    日常记录
    php实现银联支付
    PHP 判断密码强度
    laravel artisan 命令列表
    PHP && ,and ,||,or 的区别
    数组与对象的转换
    正则表达式
    微信退款
    laravel when 的用法
  • 原文地址:https://www.cnblogs.com/jeffen/p/5994021.html
Copyright © 2011-2022 走看看