cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl linking problem

From: Huw Gallon <huw_at_maxnet.co.uk>
Date: Mon, 10 Mar 2014 11:11:59 -0000

Hello all

 

 

I am attempting to build a fairly simple application in gcc C (on Redhat
Linux 6.3) which will use libcurl API functions to send email
confirmation of various events and actions to other users on the same
network. I am having difficulty building the application. I can compile
the source into an object file but not link this into an application.
The output from the build script is below (apologies for length.) The
salient points are the unreferenced functions des_set_odd_parity,
des_set_key and des_ecb_encrypt, and the unreferenced type (presumably)
__ctype_b.

 

DES_set_odd_parity, DES_set_key and DES_ecb_encrypt are all in
libcrypto.so, but the case does not match those required by libcurl.

 

 

Using built-in specs.

Target: i686-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch=i686 --build=i686-redhat-linux

Thread model: posix

gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)

COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.4.6/:/usr/libexec/gcc
/i686-redhat-linux/4.4.6/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/g
cc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/:/usr/libexec
/gcc/i686-redhat-linux/4.4.6/:/usr/libexec/gcc/i686-redhat-linux/:/usr/l
ib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/

LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-red
hat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../:/lib/:/u
sr/lib/

COLLECT_GCC_OPTIONS='-v' '-m32' '-DLINUX' '-dUNIX' '-DMULTITHREAD'
'-L/usr/lib/evolution-openldap/lib' '-L/usr/kerberos/lib' '-o'
'hlgtest4' '-mtune=generic' '-march=i686'

/usr/libexec/gcc/i686-redhat-linux/4.4.6/collect2 --eh-frame-hdr
--build-id -m elf_i386 --hash-style=gnu -dynamic-linker
/lib/ld-linux.so.2 -o hlgtest4
/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crt1.o
/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crti.o
/usr/lib/gcc/i686-redhat-linux/4.4.6/crtbegin.o
-L/usr/lib/evolution-openldap/lib -L/usr/kerberos/lib
-L/usr/lib/gcc/i686-redhat-linux/4.4.6
-L/usr/lib/gcc/i686-redhat-linux/4.4.6
-L/usr/lib/gcc/i686-redhat-linux/4.4.6/../../.. hlgtest4.o -lcurl -lldap
-llber -lplds4 -lplc4 -lnspr4 -lidn -lssh2 -lssl -lssl3 -lcrypto
-lgssapi_krb5 -lkrb5 -lk5crypto -lsasl2 -lz -lssh2 -ldl -lpthread -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/i686-redhat-linux/4.4.6/crtend.o
/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crtn.o

/usr/lib/evolution-openldap/lib/libldap.a(os-ip.o): In function
`ldap_int_poll':

(.text+0x9bc): warning: `sys_errlist' is deprecated; use `strerror' or
`strerror_r' instead

/usr/lib/evolution-openldap/lib/libldap.a(os-ip.o): In function
`ldap_int_poll':

(.text+0x9b2): warning: `sys_nerr' is deprecated; use `strerror' or
`strerror_r' instead

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o): In
function `copy_header_value':

(.text+0x8d): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o): In
function `copy_header_value':

(.text+0xf5): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o): In
function `Curl_http_input_auth':

(.text+0xa3f): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o): In
function `Curl_http_input_auth':

(.text+0xbc8): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o): In
function `Curl_http_input_auth':

(.text+0xc17): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http.o):(.text+0
xd62): more undefined references to `__ctype_b' follow

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(url.o): In
function `detect_proxy':

(.text+0x46e4): undefined reference to `__ctype_tolower'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(url.o): In
function `parse_proxy':

(.text+0x4a13): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(ssluse.o): In
function `Curl_ossl_init':

(.text+0x8b9): undefined reference to `OpenSSL_add_all_algorithms'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(escape.o): In
function `curl_easy_unescape':

(.text+0x1ce): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(mprintf.o): In
function `dprintf_DollarString':

(.text+0x9): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http_digest.o):
In function `Curl_input_digest':

(.text+0x13d): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http_digest.o):
In function `Curl_input_digest':

(.text+0x1cc): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http_digest.o):
In function `Curl_input_digest':

(.text+0x4bf): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(http_negotiate.o
):(.text+0x29b): more undefined references to `__ctype_b' follow

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `setup_des_key':

(.text+0xae): undefined reference to `des_set_odd_parity'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `setup_des_key':

(.text+0xba): undefined reference to `des_set_key'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `Curl_ntlm_core_lm_resp':

(.text+0xf8): undefined reference to `des_ecb_encrypt'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `Curl_ntlm_core_lm_resp':

(.text+0x11b): undefined reference to `des_ecb_encrypt'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `Curl_ntlm_core_lm_resp':

(.text+0x132): undefined reference to `des_ecb_encrypt'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `Curl_ntlm_core_mk_lm_hash':

(.text+0x1b2): undefined reference to `des_ecb_encrypt'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_ntlm_core.o
): In function `Curl_ntlm_core_mk_lm_hash':

(.text+0x1d0): undefined reference to `des_ecb_encrypt'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
In function `parsekeyword':

(.text+0x45): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
In function `setcharset':

(.text+0x2b2): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
In function `setcharset':

(.text+0x432): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
In function `setcharset':

(.text+0x480): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
In function `setcharset':

(.text+0x4b5): undefined reference to `__ctype_b'

/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libcurl.a(curl_fnmatch.o):
(.text+0x4dd): more undefined references to `__ctype_b' follow

collect2: ld returned 1 exit status

 

 

Have you any hints as to what I may need to define within the source
file, or build script, or what library packages (or versions of library
packages) to include, to build the application.

 

Regards

 

 

 

 

 

 

 

Huw Gallon

Maximum Network Solutions Ltd

The Old Granary, The Square

Sheffield, South Yorkshire S26 5QN

 

DDI: + 44 (0) 1909 779902

Main: + 44 (0) 1909 774477

 

www.maxnet.com <http://www.maxnet.com>
 
 
 
--------------------------------------------------------------------------
 
 
DISCLAIMER
 
This electronic message (and any attachments) is from Maximum Network
Solutions and is intended solely for the use of the intended recipient(s)
and may contain information that is confidential, potentially legally
privileged, subject to copyright or constitutes a trade secret. If you
are not the intended recipient(s) you are hereby notified that any
dissemination, copying or distribution of this message, or files
associated with this message, is strictly prohibited. If you have
received this message in error, please notify us immediately by replying
to the message or by telephone on the number above, and delete it and any
copies of it from your computer. Messages sent to and from us may be
monitored.
 
We have taken steps to ensure that this message (and any attachments or
hyperlinks contained within it) are free from computer viruses and the
like. However, in accordance with good computing practice the recipient
is responsible for ensuring that it is actually virus free before opening
it.
 
Any views or opinions presented are solely those of the author, and do
not necessarily represent those of the company.
 
Recording of Telephone Calls
  
Calls may be recorded for quality, training and security purposes.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-10