← Back to team overview

sslug-teknik team mailing list archive

Re: openssl compile problem.

 

Martin Møller Pedersen wrote:
> Hejsa,
>  Jeg kan simpelthen ikke se, hvorfor -lssl ikke virker for gcc.
>
> /usr/bin/ld: cannot find -lssl

Hvordan ser din gcc kommando ud? Har du fortalt gcc,
at den skal lede i /usr/local/ssl/lib?

gcc .... -L/usr/local/ssl/lib -lssl


OK. Lidt flere info. Jeg er ved at compilere noget nagios på debian og
configure finder ingen fejl.

1. Jeg har kompileret og installeret openssl under /usr/local/openssl/
2. Tilføjet /usr/local/openssl/lib til /etc/ld.so.conf og kørt ldconfig
3. Kørt ./configure til nagios, der ingen fejl melder og finder
diverse ssl-dimser.
4. Men make fejler:

gcc -Wall -g -O2 -o check_disk check_disk.o utils.o popen.o
-L/home/mm/nagios-plugins-1.4.3/plugins ../lib/libnagiosplug.a
../lib/libcoreutils.a -lssl -lcrypto -Wl,--rpath
-Wl,/usr/local/ssl/lib
/usr/bin/ld: cannot find -lssl
collect2: ld returned 1 exit status
make[3]: *** [check_disk] Error 1

5. Efter
    ln -s /usr/local/ssl/lib/libssl.a /usr/lib
    ln -s /usr/local/ssl/lib/libcrypto.a  /usr/lib
   giver make nu en anden fejl:

gcc -Wall -g -O2 -o check_http check_http.o sslutils.o netutils.o
utils.o  -L/home/mm/nagios-plugins-1.4.3/plugins
../lib/libnagiosplug.a ../lib/libcoreutils.a -lnsl -lresolv -lssl
-lcrypto -Wl,--rpath -Wl,/usr/local/ssl/lib
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x45):
In function `dlfcn_load':
: undefined reference to `dlopen'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0xc4):
In function `dlfcn_load':
: undefined reference to `dlclose'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x102):
In function `dlfcn_load':
: undefined reference to `dlerror'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x1ad):
In function `dlfcn_bind_var':
: undefined reference to `dlsym'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x1f2):
In function `dlfcn_bind_var':
: undefined reference to `dlerror'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x2ed):
In function `dlfcn_bind_func':
: undefined reference to `dlsym'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x337):
In function `dlfcn_bind_func':
: undefined reference to `dlerror'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libcrypto.a(dso_dlfcn.o)(.text+0x68a):
In function `dlfcn_unload':
: undefined reference to `dlclose'
collect2: ld returned 1 exit status
make[3]: *** [check_http] Error 1


HJÆLP

Mvh
/Martin





checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking openssl/x509.h usability... yes
checking openssl/x509.h presence... yes
checking for openssl/x509.h... yes
checking openssl/rsa.h usability... yes
checking openssl/rsa.h presence... yes
checking for openssl/rsa.h... yes
checking openssl/pem.h usability... yes
checking openssl/pem.h presence... yes
checking for openssl/pem.h... yes
checking openssl/crypto.h usability... yes
checking openssl/crypto.h presence... yes
checking for openssl/crypto.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking for main in -lssl... yes


Follow ups

References