# Unbound 1.4.21.1 does not compile



## zongosaiba (Dec 1, 2013)

Greetings, 

I'm trying to compile the newest Unbound from ports.  I am using FreeBSD 9.2 in VMware 10*.* I have an error that I do not comprehend. Any help is much appreciated of course*.*


```
daemon.c:(.text+0xa42): undefined reference to `ldns_key_EVP_load_gost_id'
.libs/val_secalgo.o: In function `verify_canonrrset':
val_secalgo.c:(.text+0x37b): undefined reference to `ldns_gost2pkey_raw'
.libs/val_secalgo.o: In function `dnskey_algo_id_is_supported':
val_secalgo.c:(.text+0x6c7): undefined reference to `ldns_key_EVP_load_gost_id'
gmake: *** [unbound] Error 1
*** [do-build] Error code 1

Stop in /usr/ports/dns/unbound.
*** [install] Error code 1

Stop in /usr/ports/dns/unbound.
```

Kind regards,

zongo saiba


----------



## trh411 (Dec 1, 2013)

I just built dns/unbound on my FreeBSD-9.2 VirtualBox VM without any problems. Maybe your local ports tree is in need of updating? Anything funky in your /etc/make.conf?


----------



## zongosaiba (Dec 1, 2013)

@trh411, thanks for your reply. Good to know that it builds.  I am using VMware but I don't think that should be an issue.  I have not added anything in my make.conf file. It only contains

```
PERL_VERSION=5.14.4
```

I ran updates on ports*.*  I deleted the configuration (`#make rmconfig`)*.* Then I installed fresh with `# make install clean`.  I am getting another error*.* If I try to decode the logs, it looks like there are conflicting libraries. I am really not sure. Its quite hard to decypher for a newbie  :beergrin 


```
/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/lib/libldns.so, may conflict with libcrypto.so.8
/usr/bin/ld: warn/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/lib/libldns.so, may conflict with libcrypto.so.8
ing: libcrypto.so.6, needed by /usr/local/lib/libldns.so, may conflict with libcrypto.so.8
/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/lib/libldns.so, may conflict with libcrypto.so.8
/usr/ports/dns/unbound/work/unbound-1.4.21/.libs/libunbound.so: undefined reference to `ldns_gost2pkey_raw'
/usr/ports/dns/unbound/work/unbound-1.4.21/.libs/libunbound.so: undefined reference to `ldns_key_EVP_load_gost_id'
gmake: *** [unbound-host] Error 1
gmake: *** Waiting for unfinished jobs....
.libs/daemon.o: In function `daemon_init':
daemon.c:(.text+0xa42): undefined reference to `ldns_key_EVP_load_gost_id'
.libs/val_secalgo.o: In function `verify_canonrrset':
val_secalgo.c:(.text+0x37b): undefined reference to `ldns_gost2pkey_raw'
.libs/val_secalgo.o: In function `dnskey_algo_id_is_supported':
val_secalgo.c:(.text+0x6c7): undefined reference to `ldns_key_EVP_load_gost_id'
gmake: *** [unbound] Error 1
.libs/val_secalgo.o: In function `verify_canonrrset':
val_secalgo.c:(.text+0x37b): undefined reference to `ldns_gost2pkey_raw'
.libs/val_secalgo.o: In function `dnskey_algo_id_is_supported':
val_secalgo.c:(.text+0x6c7): undefined reference to `ldns_key_EVP_load_gost_id'
.libs/val_secalgo.o: In function `verify_canonrrset':
val_secalgo.c:(.text+0x37b): undefined reference to `ldns_gost2pkey_raw'
.libs/val_secalgo.o: In function `dnskey_algo_id_is_supported':
val_secalgo.c:(.text+0x6c7): undefined reference to `ldns_key_EVP_load_gost_id'
gmake: *** [unbound-control] Error 1
gmake: *** [unbound-checkconf] Error 1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /usr/ports/dns/unbound.
*** [install] Error code 1

Stop in /usr/ports/dns/unbound.
```


----------



## trh411 (Dec 2, 2013)

The conflicting libraries are just warnings. That issue might require some looking into after the build, particularly if you have run-time issues.

Are you using lang/gcc to build dns/unbound? I built it using lang/clang.


----------



## zongosaiba (Dec 2, 2013)

I am using GCC. As soon as I have some time will switch to Clang and report back.


----------



## zongosaiba (Dec 2, 2013)

@trh411, thank you for help on my issue. Compiling with clang solved everything. I have a fresh install of unbound 1.4.21 installed and ready to roll. Thank you for taking the time.


----------



## trh411 (Dec 2, 2013)

Glad to hear you successfully built dns/unbound.

Given that lang/clang is the default compiler on FreeBSD-9.2, you will be better off just accepting that as the default for all port builds. If a particular port requires lang/gcc to build, the port maintainer will specify that in the port's Makefile and then the build will USE_GCC to build that port.

Happy to help.


----------

