How to Resolve undefined reference to 'RAND_egd'
3
votes
2
answers
6132
views
**Debian 8 Jessie, OpenSSL version 1.1.0,
cURL version: 7.50.2**
I am trying to build curl on a Linux Debian system. All stages go well up until trying to build with
make
command. The linking stage fails with the following error below:
CC ../lib/curl-nonblock.o
CC ../lib/curl-warnless.o
CCLD curl
../lib/.libs/libcurl.so: undefined reference to 'RAND_egd'
collect2: error: ld returned 1 exit status
Makefile:771: recipe for target 'curl' failed
make: *** [curl] Error 1
RAND_egd function is part of the OpenSSL library so I ran ldd on the libcurl.so file to make sure the OpenSSL library is found, and it is judging by the output from ldd below.
linux-vdso.so.1 (0x00007ffceb5a1000)
libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007ff9ffc05000)
libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007ff9ff9d1000)
libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007ff9ff7a8000)
libssl.so.1.1 => /usr/local/lib/libssl.so.1.1 (0x00007ff9ff53a000)
libcrypto.so.1.1 => /usr/local/lib/libcrypto.so.1.1 (0x00007ff9ff0af000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007ff9feea0000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007ff9fec4e000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff9fea33000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff9fe688000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ff9fe3a6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff9fe1a2000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff9fdf85000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007ff9fdd6e000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007ff9fdb52000)
libgnutls-deb0.so.28 => /usr/lib/x86_64-linux-gnu/libgnutls-deb0.so.28 (0x00007ff9fd833000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffa0009e000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ff9fd621000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007ff9fd3db000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007ff9fd1c7000)
libnettle.so.4 => /usr/lib/x86_64-linux-gnu/libnettle.so.4 (0x00007ff9fcf95000)
libhogweed.so.2 => /usr/lib/x86_64-linux-gnu/libhogweed.so.2 (0x00007ff9fcd66000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007ff9fcae3000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff9fc8db000)
So the library is there. I also checked the rand.h file in the include directory of OpenSSL and of course the function declaration is there, so it should be defined in the library. How can I find the cause of and resolve this error?
Asked by strwils
(131 rep)
Sep 2, 2016, 07:17 PM
Last activity: Apr 26, 2025, 02:04 AM
Last activity: Apr 26, 2025, 02:04 AM