【Linux】【curl】ubuntu編譯libcurl__Linux

來源:互聯網
上載者:User
一、下載libcurl http://curl.haxx.se/download/curl-7.21.1.tar.gz 二、安裝   指定了安裝目錄     /usr/local/curl 注意:在這裡最好用預設的路徑 命令1: ./configure --prefix=/usr/local/curl該為命令:./configure 這樣,在編譯器的時候直接使用 gcc -o filename -Wall filename.c -lcurl 就不會出現編譯連結錯誤, 如果你的路徑改變了,那麼在編譯器時可能會比較麻煩。 結果:   curl version:    7.21.1   Host setup:      i686-pc-linux-gnu   Install prefix:  /usr/local/curl   Compiler:        gcc   SSL support:     enabled (OpenSSL)   SSH support:     no      (--with-libssh2)   zlib support:    enabled   krb4 support:    no      (--with-krb4*)   GSSAPI support:  no      (--with-gssapi)   SPNEGO support:  no      (--with-spnego)   resolver:        default (--enable-ares / --enable-threaded-resolver)   ipv6 support:    enabled   IDN support:     enabled   Build libcurl:   Shared=yes, Static=yes   Built-in manual: enabled   Verbose errors:  enabled (--disable-verbose)   SSPI support:    no      (--enable-sspi)   ca cert bundle:  /etc/ssl/certs/ca-certificates.crt   ca cert path:    no   LDAP support:    enabled (OpenLDAP)   LDAPS support:   enabled   RTSP support:    enabled   RTMP support:    no      (--with-librtmp)   Protocols:       DICT FILE FTP FTPS HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP 命令2:make 命令3:sudo make install 可以看到lib庫,已經安裝在 /usr/local/curl/lib ---------------------------------------------------------------------- Libraries have been installed in:    /usr/local/curl/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable      during execution    - add LIBDIR to the `LD_RUN_PATH' environment variable      during linking    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag    - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. 在安裝目錄下/usr/local/curl下會有四個目錄 bin  include  lib  share 包含了所需的庫、標頭檔等

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.