Link error building with gcrypt

Bruce A. Johnson sancho at topcog.com
Tue Mar 6 18:13:48 CET 2012


I apologize for asking such a basic question, but I'm trying to compile 
a program that uses the gcrypt library, and I can't get to square one. 
The linker seems to be unable to find gcry_check_version, even though I 
have gcrypt-dev installed.

> [bjohnson at brn-601 ~/fubar/src]% make
> gcc  -g -O2 -L/lib/i386-linux-gnu -lgcrypt  -o fubar fubar.o
> fubar.o: In function `main':
> /home/bjohnson/fubar/src/fubar.c:13: undefined reference to `gcry_check_version'
> collect2: ld returned 1 exit status
> make: *** [fubar] Error 1
> [bjohnson at brn-601 ~/fubar/src]% ls -l /lib/i386-linux-gnu/*gcrypt*
> -rw-r--r-- 1 root root 817420 2011-07-11 08:19 /lib/i386-linux-gnu/libgcrypt.a
> lrwxrwxrwx 1 root root     19 2011-07-11 08:19 /lib/i386-linux-gnu/libgcrypt.so -> libgcrypt.so.11.7.0
> lrwxrwxrwx 1 root root     19 2012-01-03 12:54 /lib/i386-linux-gnu/libgcrypt.so.11 -> libgcrypt.so.11.7.0
> -rw-r--r-- 1 root root 541100 2011-07-11 08:19 /lib/i386-linux-gnu/libgcrypt.so.11.7.0
> [bjohnson at brn-601 ~/fubar/src]% nm /lib/i386-linux-gnu/libgcrypt.a | grep gcry_check_version
>          U _gcry_check_version
> 00000060 T gcry_check_version
> 00000250 T _gcry_check_version

This is on a Linux Mint 12 system.  Can anyone suggest what I'm missing 
here?

Thanks!
--
Bruce A. Johnson
Herndon, Virginia



More information about the Gcrypt-devel mailing list