Newbie help

Craig Graham craig at
Wed Apr 14 08:23:15 CEST 2004

I've installed libgcrypt 1.1.42 and libgpg-error 0.6 but am having problems
building the example "basic.c" from the tests directory. This is likely to
be something quite simple because I've never manually built anything before
on Linux!

I'm using Borland CBuilderX and it compiles fine, but on linking I get many
errors. By doing the linking step manually I can reproduce the problem in a
more portable way;

[root at splosh Debug_Build]# g++ -o test basic.o -lgcrypt -lgpg-error
basic.o(.text+0x10e): In function `check_cbc_mac_cipher':
/usr/NETDRIVE/Work/basic.c:108: undefined reference to
basic.o(.text+0x2a8):/usr/NETDRIVE/Work/basic.c:130: undefined reference to
basic.o(.text+0x328):/usr/NETDRIVE/Work/basic.c:138: undefined reference to
basic.o(.text+0x467):/usr/NETDRIVE/Work/basic.c:152: undefined reference to
basic.o(.text+0x621): In function `check_aes128_cbc_cts_cipher':
/usr/NETDRIVE/Work/basic.c:224: undefined reference to
basic.o(.text+0x670):/usr/NETDRIVE/Work/basic.c:231: more undefined
references to `gpg_strerror(unsigned)' follow
collect2: ld returned 1 exit status

It makes no difference which order I put the last three arguments in.

I've confirmed that the function is in the library;

   [root at splosh craig]# nm /usr/local/lib/ |grep
    00000990 T gpg_strerror
    00000af0 T gpg_strerror_r
    [root at splosh craig]#

and since g+ has given no error about being able to find the two libraries,
and it does give errors if I mistype the name to test, it seems to be able
to load them.

Can anyone point out my mistake?

Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK.

More information about the Gcrypt-devel mailing list