Maintained by: NLnet Labs

[Unbound-users] libunbound examples compile issue

Paul Wouters
Sun Sep 27 21:52:16 CEST 2009


On Sun, 27 Sep 2009, Paul Freeman wrote:

> Hi I wonder if anyone has any idea about the following issue,
> test compiling any of the examples at:
>   http://www.unbound.net/documentation/libunbound-tutorial-1.html
>
> doesn't seem to link correctly, (any help appreciated) basic process
> used was as follows:
>
> wget http://www.unbound.net/downloads/unbound-1.3.3.tar.gz   OK
> tar -xvzf unbound-1.3.3.tar.gz && cd unbound-1.3.3           OK
> ./configure --prefix=/home/cache/ub                          OK
> make -j6 && make install && cd ..                            OK
>
> wget http://www.unbound.net/documentation/example_1.c        OK
> gcc -o example1 example_1.c -Iub/include -Lub/lib -lunbound  ...
>
>
> ub/lib/libunbound.so: undefined reference to `ldns_calc_keytag_raw'
> ub/lib/libunbound.so: undefined reference to `ldns_rr_set_owner'
> ub/lib/libunbound.so: undefined reference to `ldns_fget_token_l'

Do you have ldns headers installed? Is it in your include path?
On a Fedora system, with ldns-devel and unbound-devel installed, this
works fine:

cc example_1.c -o example_1 -lunbound -I/usr/include

Paul