getdnsapi / getdns

A modern asynchronous DNS API https://getdnsapi.net/
Other
461 stars 127 forks source link

Missing linking to gmp library when building with USE_GNUTLS #510

Open hanvinke opened 3 years ago

hanvinke commented 3 years ago

Trying to build v.1.7.0 from tarball. Am I missing sourcecode?

ARCH-PC% cd /home/han/Downloads/getdns-1.7.0 ARCH-PC% make [ 1%] Building C object CMakeFiles/getdns_objects.dir/src/anchor.c.obj In file included from /home/han/Downloads/getdns-1.7.0/src/tls.h:41, from /home/han/Downloads/getdns-1.7.0/src/context.h:53, from /home/han/Downloads/getdns-1.7.0/src/anchor.c:39: /home/han/Downloads/getdns-1.7.0/src/gnutls/tls-internal.h:41:10: fatale fout: gnutls/dane.h: Bestand of map bestaat niet 41 | #include <gnutls/dane.h> | ^~~~~~~ compilatie is beëindigd. make[2]: [CMakeFiles/getdns_objects.dir/build.make:76: CMakeFiles/getdns_objects.dir/src/anchor.c.obj] Fout 1 make[1]: [CMakeFiles/Makefile2:1219: CMakeFiles/getdns_objects.dir/all] Fout 2 make: *** [Makefile:146: all] Fout `2

hanvinke commented 3 years ago

My error. I thought I had gnutls-openssl (for Arch Linux) installed. But I had to remove it because pamac had recently issues with pacman Pacman v6.0.0. However now I am getting another build error :

[ 42%] Linking C executable tests_stub_sync /usr/bin/ld: libgetdns.a(val_secalgo.c.obj): undefined reference to symbol '__gmpz_clear' /usr/bin/ld: /usr/lib/libgmp.so.10: error adding symbols: DSO missing from command line collect2: fout: ld gaf exit-status 1 terug make[2]: [CMakeFiles/tests_stub_sync.dir/build.make:108: tests_stub_sync] Fout 1 make[1]: [CMakeFiles/Makefile2:172: CMakeFiles/tests_stub_sync.dir/all] Fout 2 make: *** [Makefile:146: all] Fout 2

Sorry, I have to change the title.

hanvinke commented 3 years ago

Seems some missing linking to the gmp library when building with gnutls enabled. Some useful code on the internet: https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch ..

-# May need gmp library on Unix. -if (UNIX)

  • find_library(NETTLE_GMP_LIBRARY gmp)
  • if (NETTLE_GMP_LIBRARY)
  • list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}")
  • endif ()

Etc.