What do you get if you try to link it using -lcrypto instead of -lssl?

And are those actual files in /var/tmp/build-root/usr/lib, or are they
(possibly broken) symlinks?  On my system, /usr/lib/libcrypto.so*
and /usr/lib/libssl.so* are all symlinks into /lib.

-- Murphy

On Sun, 2010-07-04 at 04:35 -0700, Jad Naous wrote:
> A little background: I'm using a chrooted environment that is cleaned
> on every build to build the rpm.
> 
> Here're the relevant lines from the .spec file:
> 
> echo "int main () { MD5_Init(); }" > test.c
> gcc test.c -lssl
> 
> Here's the output:
> 
> /tmp/ccCpLzVg.o: In function `main':
> test.c:(.text+0x7): undefined reference to `MD5_Init'
> collect2: ld returned 1 exit status
> 
> So it appears the linker is not finding the lib even though it's there:
> 
> $ ls /var/tmp/build-root/usr/lib/libcrypto*
> /var/tmp/build-root/usr/lib/libcrypto.a
> /var/tmp/build-root/usr/lib/libcrypto.so
> /var/tmp/build-root/usr/lib/libcrypto.so.0.9.8
> 
> where /var/tmp/build-root is the chroot root dir. Adding -L/usr/lib to
> the gcc options didn't work either.
> 
> Any other ideas?
> 
> Thanks,
> Jad.
> 
> On Sun, Jul 4, 2010 at 3:14 AM, James "Murphy" McCauley <jam...@nau.edu> 
> wrote:
> > That error message isn't actually indicative of the problem.
> >
> > My first guess is that there's a problem with your libcrypto (possibly a
> > bad symlink?).
> >
> > Can you check that /usr/lib/libcrypto.so (or some versioned filename)
> > exists, and that any/all libcrypto symlinks are okay?
> >
> > You could also just try compiling the following test program:
> > int main () { MD5_Init(); }
> >
> > See if either "gcc test.c -lssl" or "gcc test.c -lcrypto" does anything
> > interesting.  They *should* both just work, but hopefully they'll give
> > some linker error message for you.
> >
> > -- Murphy
> >
> > On Sun, 2010-07-04 at 02:01 -0700, Jad Naous wrote:
> >> Hi,
> >>
> >> I'm having issues building an opensuse 11.2 rpm package for nox. I've
> >> installed libopenssl-devel but configure complains as follows:
> >>
> >>
> >> checking if Xerces C++ Parser version is >= 2.7.0... yes
> >> checking pcap.h usability... yes
> >> checking pcap.h presence... yes
> >> checking for pcap.h... yes
> >> checking openssl/md5.h usability... yes
> >> checking openssl/md5.h presence... yes
> >> checking for openssl/md5.h... yes
> >> checking for MD5_Init in -lssl... no
> >> configure: error: openssl/md5.h not found. NOX requires OpenSSL
> >> error: Bad exit status from /var/tmp/rpm-tmp.ijg11O (%prep)
> >>
> >>
> >> Indeed, /usr/include/ssl/md5.h exists and a prototype for MD5_Init is
> >> defined there. Any thoughts?
> >>
> >> Thanks,
> >> Jad.
> >>
> >> _______________________________________________
> >> nox-dev mailing list
> >> nox-dev@noxrepo.org
> >> http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
> >
> >
> >
> > _______________________________________________
> > nox-dev mailing list
> > nox-dev@noxrepo.org
> > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
> >



_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to