cURL / Mailing Lists / curl-library / Single Mail

curl-library

fail to compile libcurl with openssl and libssh2

From: »ÆÐÄâù <balloon121_at_gmail.com>
Date: Sun, 12 Feb 2012 12:16:25 +0800

Hi,
   I meet a problem that may need your help,here is the situation:
   As I need my libcurl.a to support https,sftp and tftp protocol, so I
compile it with openssl and libssh2.
   I have already compiled and installed openssl to /usr/local/ssl, and
libssh2 to /usr/local/ssh2,the version is :

    curl: curl-7.21.3
    openssl: openssl-0.9.8k
    libssh2: libssh2-1.2

    Here is my configure command when compile curl:

   ./configure --enable-http --enable-ftp --enable-proxy --enable-tftp
--enable-static --with-ssl=/usr/local/ssl --with-libssh2=/usr/local/ssh2
--enable-ipv6 --enable-shared --disable-ldap --without-libidn
 --disable-rtsp --without-zlib

    It succeed with:

    configure: Configured to build curl/libcurl:

  curl version: 7.21.3
  Host setup: i686-pc-linux-gnu
  Install prefix: /usr/local
  Compiler: gcc
  SSL support: enabled (OpenSSL)
  SSH support: enabled (libSSH2)
  zlib support: no (--with-zlib)
  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: no (--with-libidn)
  Build libcurl: Shared=yes, Static=yes
  Built-in manual: enabled
  Verbose errors: enabled (--disable-verbose)
  SSPI support: no (--enable-sspi)
  ca cert bundle: /usr/share/ssl/certs/ca-bundle.crt
  ca cert path: no
  LDAP support: no (--enable-ldap / --with-ldap-lib /
--with-lber-lib)
  LDAPS support: no (--enable-ldaps)
  RTSP support: no (--enable-rtsp)
  RTMP support: no (--with-librtmp)
  Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3
POP3S SCP SFTP SMTP SMTPS TELNET TFTP

  Then I try to make by command "make LDFLAGS=-all-static" , error
occurs,here is part of the error message:

libtool: link: gcc -g0 -O2 -Wno-system-headers -static -o curl main.o
hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o curlutil.o
os-specific.o xattr.o strtoofft.o strdup.o rawstr.o nonblock.o
 ../lib/.libs/libcurl.a -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err
-lk5crypto -lresolv -ldl -lz -lrt
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libcrypto.a(dso_dlfcn.o)(.text+0x6a):
In function `dlfcn_load':
: Using 'dlopen' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
homedir.o(.text+0x73): In function `homedir':
: Using 'getpwuid' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking
../lib/.libs/libcurl.a(curl_addrinfo.o)(.text+0x86): In function
`Curl_getaddrinfo_ex':
: Using 'getaddrinfo' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libkrb5.a(fcc_gennew.o)(.text+0x6c):
In function `krb5_fcc_generate_new':
: the use of `mktemp' is dangerous, better use `mkstemp'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libkrb5.a(sn2princ.o)(.text+0x22b):
In function `krb5_sname_to_principal':
: Using 'gethostbyaddr' in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libkrb5.a(def_realm.o)(.text+0x162):
In function `krb5_get_default_realm':
: Using 'gethostbyname' in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libkrb5.a(locate_kdc.o)(.text+0x250):
In function `krb5_locate_srv_conf':
: Using 'getservbyname' in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking
../lib/.libs/libcurl.a(ssh.o)(.text+0x326): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_startup'
../lib/.libs/libcurl.a(ssh.o)(.text+0x3b7): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_set_blocking'
../lib/.libs/libcurl.a(ssh.o)(.text+0x42d): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_hostkey'
../lib/.libs/libcurl.a(ssh.o)(.text+0x4a1): In function `ssh_statemach_act':
: undefined reference to `libssh2_knownhost_check'
../lib/.libs/libcurl.a(ssh.o)(.text+0x588): In function `ssh_statemach_act':
: undefined reference to `libssh2_knownhost_add'
../lib/.libs/libcurl.a(ssh.o)(.text+0x5bd): In function `ssh_statemach_act':
: undefined reference to `libssh2_knownhost_writefile'
../lib/.libs/libcurl.a(ssh.o)(.text+0x69f): In function `ssh_statemach_act':
: undefined reference to `libssh2_hostkey_hash'
../lib/.libs/libcurl.a(ssh.o)(.text+0x750): In function `ssh_statemach_act':
: undefined reference to `libssh2_userauth_list'
../lib/.libs/libcurl.a(ssh.o)(.text+0x76d): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_last_errno'
../lib/.libs/libcurl.a(ssh.o)(.text+0xa0c): In function `ssh_statemach_act':
: undefined reference to `libssh2_userauth_publickey_fromfile_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0xa89): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0xb30): In function `ssh_statemach_act':
: undefined reference to `libssh2_userauth_password_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0xc03): In function `ssh_statemach_act':
: undefined reference to `libssh2_userauth_keyboard_interactive_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0xcf2): In function `ssh_statemach_act':
: undefined reference to `libssh2_sftp_init'
../lib/.libs/libcurl.a(ssh.o)(.text+0xd13): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_last_errno'
../lib/.libs/libcurl.a(ssh.o)(.text+0xd3b): In function `ssh_statemach_act':
: undefined reference to `libssh2_session_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0xda5): In function `ssh_statemach_act':
: undefined reference to `libssh2_sftp_symlink_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0xe00): In function `ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x13f6): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_stat_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x15ee): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1660): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_stat_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1688): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1708): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_symlink_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1730): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x179e): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_mkdir_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x17cc): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1842): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_rename_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x186a): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x18d4): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_rmdir_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1902): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x195c): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_unlink_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x198a): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_last_error'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1a8f): In function
`ssh_statemach_act':
: undefined reference to `libssh2_sftp_open_ex'
../lib/.libs/libcurl.a(ssh.o)(.text+0x1be6): In function
`ssh_statemach_act':

 Could please help to give some advice? Thanks.

Best regards,
Cindy

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-12