RE: undefined symbol: gcry_md_hash_buffer‏

Honia A honia2002 at
Thu Jun 17 16:52:51 CEST 2010

Good morning dkg,


Thanks for your helpful reply. I removed the collectd package and started over, this time gave collectd a different path for libgcrypt: 

./configure --with-librrd=/opt/rrdtool-1.4.3/ --with-liboping=/opt/oping --with-libnetlink=/home/username/iproute2-2.6.29-1 --with-libgcrypt=/usr/local


I ran all your commands and here are the outputs: (in red)


1) readelf -s /opt/collectd/lib/collectd/ | grep md_hash
    93: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND gcry_md_hash_buffer
   239: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND gcry_md_hash_buffer
2) ldd /opt/collectd/lib/collectd/ | grep gcry
I got no output here
3) readelf -s /usr/lib/ | grep md_hash

109: 00005570   115 FUNC    GLOBAL DEFAULT   11 gcry_md_hash_buffer@@GCRYPT_1.2

Somethings I noticed are:


1) has a line in it which reads: 

# Libraries that this one depends upon.

dependency_libs=' -L/usr/local/lib -lpthread -ldl'


2) libgcrypt-config file is located here:




3) In libgcrypt-config:


includedir = /usr/local/include



4) Inside collectd's src directory's network.c there is a line which reads:


# include <gcrypt.h>
# endif


5) find / -name



 In the libgcrypt manual, it says that I have to do the following:

"If you want to compile a source file including the `gcrypt.h' header file, you must make sure that the compiler can find it in the directory hierarchy. This is accomplished by adding the path to the directory in which the header file is located to the compilers include file search path (via the -I option). 
However, the path to the include file is determined at the time the source is configured. To solve this problem, Libgcrypt ships with a small helper program libgcrypt-config that knows the path to the include file and other configuration options. The options that need to be added to the compiler invocation at compile time are output by the --cflags option to libgcrypt-config. The following example shows how it can be used at the command line: "     gcc -c foo.c `libgcrypt-config --cflags`


So I tried to link the network source code to libgcrypt library via command below but got so many errors.

gcc -c network.c `libgcrypt-config --cflags`


Thanks in advance for the help,


> Date: Thu, 17 Jun 2010 10:14:19 -0400
> From: dkg at
> To: honia2002 at
> CC: gcrypt-devel at
> Subject: Re: undefined symbol: gcry_md_hash_buffer‏
> On 06/14/2010 09:55 AM, honi@ wrote:
> > I am installing collectd-4.10.0 on a CentOS 5 machine:
> I don't use collectd or CentOS, but i'm happy to help you debug:
> > 4) Restarted collectd and got the following error: 
> > 
> > Stopping collectd: [FAILED]
> > Starting collectd: /opt/collectd/sbin/collectd: symbol lookup error:
> > /opt/collectd/lib/collectd/ undefined symbol: gcry_md_hash_buffer
> what output do you get from:
> readelf -s /opt/collectd/lib/collectd/ | grep md_hash
> ldd /opt/collectd/lib/collectd/ | grep gcry
> readelf -s /usr/lib/ | grep md_hash
> ?
> when i install debian's packaged collectd 4.9.1-2 on a testing system, i
> see this on the equivalent files:
> >> 0 dkg at pip:~$ readelf -s /usr/lib/collectd/ | grep md_hash
> >> 87: 00000000 0 FUNC GLOBAL DEFAULT UND gcry_md_hash_buffer at GCRYPT_1.2 (5)
> >> 0 dkg at pip:~$ ldd /usr/lib/collectd/ | grep gcry
> >> => /usr/lib/ (0xb7661000)
> >> 0 dkg at pip:~$ readelf -s /usr/lib/ | grep md_hash
> >> 101: 00006130 115 FUNC GLOBAL DEFAULT 13 gcry_md_hash_buffer@@GCRYPT_1.2
> >> 0 dkg at pip:~$ 
> i think these three lines of output mean:
> /usr/lib/collectd/ expects to see
> gcry_md_hash_bufer at GCRYPT1.2 in some library that it will load (it is
> undefined internally, hence the "UND")
> /usr/lib/collectd/ expects to load, which the
> dynamic linker finds in /usr/lib
> /usr/lib/ contains a defined symbol
> gcry_md_hash_bufer at GCRYPT1.2
> maybe one of these doesn't line up for you somehow?
> --dkg
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20100617/eb05370a/attachment-0001.htm>

More information about the Gcrypt-devel mailing list