Libunbound examples compile issue

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'
ub/lib/libunbound.so: undefined reference to `ldns_rr_owner'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_new'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_type'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_int16'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_dname'
ub/lib/libunbound.so: undefined reference to `ldns_rr_free'
ub/lib/libunbound.so: undefined reference to `ldns_rr_set_type'
ub/lib/libunbound.so: undefined reference to `ldns_rr_descript'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_rr_count'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_int8'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_tsig'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_loc'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_nsec3_salt'
ub/lib/libunbound.so: undefined reference to `ldns_rr_new_frm_str'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_clone'
ub/lib/libunbound.so: undefined reference to `ldns_rr_rdf'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_time'
ub/lib/libunbound.so: undefined reference to `ldns_pkt2buffer_str'
ub/lib/libunbound.so: undefined reference to `ldns_buffer2pkt_wire'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_apl'
ub/lib/libunbound.so: undefined reference to `ldns_rr_ttl'
ub/lib/libunbound.so: undefined reference to `ldns_dname_new_frm_str'
ub/lib/libunbound.so: undefined reference to `ldns_rr_set_class'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_cat_clone'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_hex'
ub/lib/libunbound.so: undefined reference to `ldns_key_buf2rsa_raw'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_a'
ub/lib/libunbound.so: undefined reference to `ldns_rr_get_class'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_wks'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_b64'
ub/lib/libunbound.so: undefined reference to `ldns_rr_rd_count'
ub/lib/libunbound.so: undefined reference to `ldns_rr_get_type'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_aaaa'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_unknown'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_str'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_service'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_deep_free'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_alg'
ub/lib/libunbound.so: undefined reference to `ldns_b32_ntop_extended_hex'
ub/lib/libunbound.so: undefined reference to `ldns_rr_clone'
ub/lib/libunbound.so: undefined reference to `ldns_rr_dnskey_key_size_raw'
ub/lib/libunbound.so: undefined reference to `ldns_buffer_free'
ub/lib/libunbound.so: undefined reference to `ldns_rr_new_frm_fp_l'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_nsap'
ub/lib/libunbound.so: undefined reference to `ldns_key_buf2dsa_raw'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_nsec'
ub/lib/libunbound.so: undefined reference to `ldns_get_errorstr_by_id'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_free'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_rr'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_push_rr'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_period'
ub/lib/libunbound.so: undefined reference to `ldns_b32_pton_extended_hex'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_b32_ext'
ub/lib/libunbound.so: undefined reference to `ldns_rcodes'
ub/lib/libunbound.so: undefined reference to `ldns_buffer_new'
ub/lib/libunbound.so: undefined reference to `ldns_dname_cat_clone'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_int32'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_cert_alg'
ub/lib/libunbound.so: undefined reference to `ldns_buffer_copy'
ub/lib/libunbound.so: undefined reference to `ldns_str2rdf_class'
ub/lib/libunbound.so: undefined reference to `ldns_rr_rdata2buffer_wire'
ub/lib/libunbound.so: undefined reference to `ldns_rr_list_contains_rr'
ub/lib/libunbound.so: undefined reference to `ldns_rr_classes'
ub/lib/libunbound.so: undefined reference to `ldns_rr_new'
ub/lib/libunbound.so: undefined reference to `ldns_rdf2str'
collect2: ld returned 1 exit status

Regards
Paul Freeman,

NOC4 Limited

+44(0)1844 318 083 (Direct)
+44(0)1844 318 104 (Fax)

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

Thanks for that Paul, used ldns 1.6.1 and rebuilt unbound + examples
against it and everything worked fine!

Linked tutorial to ldns at the compile instructions to help
other people that stumble on to this.

Best regards,
   Wouter