[Fwd: Re: [SLUG] ld: cannot find -lssl]

Peter Hardy <[email protected]> Mon, 30 Aug 2004 13:15:02 +1000
Newsgroups gmane.org.user-groups.slug.pearls
Message-ID <1093835701.27701.4.camel@picasso>
--=-HQxAxLdi4YoFnFD0vlmJ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Best answer to the "Why isn't this library found?" FAQ ever.

--=-HQxAxLdi4YoFnFD0vlmJ
Content-Disposition: inline
Content-Description: Forwarded message - Re: [SLUG] ld: cannot find -lssl
Content-Type: message/rfc822

Return-Path: <[email protected]>
Received: from maddog.slug.org.au (slug.progsoc.uts.edu.au [138.25.7.4]) by
	flute.bandcamp.tv (8.12.3/8.12.3/Debian-6.6) with ESMTP id
	i7OMuUiP028619
	for <[email protected]>; Wed, 25 Aug 2004 08:56:30 +1000
Received: from maddog.slug.org.au (localhost [127.0.0.1]) by
	maddog.slug.org.au (Postfix) with ESMTP id C0549109F1D; Wed, 25 Aug 2004
	08:56:12 +1000 (EST)
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from gryphon.hezmatt.org (eth1859.nsw.adsl.internode.on.net
	[150.101.200.66]) by maddog.slug.org.au (Postfix) with ESMTP id
	6810A109F19
	for <[email protected]>; Wed, 25 Aug 2004 08:55:52 +1000 (EST)
Received: from mpalmer by gryphon.hezmatt.org with local (Exim 3.34 #1
	(Debian)) id 1Bzk9l-0003Cp-00 for <[email protected]>; Wed, 25 Aug 2004
	08:52:45 +1000
Date: Wed, 25 Aug 2004 08:52:45 +1000
From: Matthew Palmer <[email protected]>
To: Slug <[email protected]>
Subject: Re: [SLUG] ld: cannot find -lssl
Message-ID: <[email protected]>
Mail-Followup-To: Slug <[email protected]>
References: <[email protected]>
Mime-Version: 1.0
In-Reply-To: <[email protected]>
User-Agent: Mutt/1.5.6+20040523i
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: Linux and Free Software Discussion <slug.slug.org.au>
List-Unsubscribe: <http://lists.slug.org.au/listinfo/slug>,
	<mailto:[email protected]?subject=unsubscribe>
List-Archive: <http://lists.slug.org.au/archives/slug>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[email protected]?subject=help>
List-Subscribe: <http://lists.slug.org.au/listinfo/slug>,
	<mailto:[email protected]?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0394917641=="
Mime-version: 1.0
Sender: [email protected]
Errors-To: [email protected]
X-Spam-Status: No, hits=-104.2 required=5.0 tests=AWL,BAYES_00,
	USER_IN_WHITELIST autolearn=ham version=2.64
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flute.bandcamp.tv
X-Virus-Scanned: clamd / ClamAV version 0.75-1, clamav-milter version 0.75c
	on flute
X-Virus-Status: Clean


--===============0394917641==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="Dzs2zDY0zgkG72+7"
Content-Disposition: inline


--Dzs2zDY0zgkG72+7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 25, 2004 at 12:45:36AM +1000, Rocci wrote:
> Hi folks,
> I'm trying to compile source for the wpa supplicant but the linker=20
> complains about ssl.
> I've got openssl installed (deb package) and I'm not sure exactly which=
=20
> library it's looking for.
> Ideas/suggestions/clues that may point this newb to the right direction=
=20
> would be greatly appreciated.

Short answer:

Building programs typically requires the 'dev' version of the necessary
packages to be installed.  In this instance, you need to install libssl-dev.

Long answer:

The -l flag is essentially a shorthand for "look for lib<whatever>.so ||
lib<whatever>.a in all the configured library directories".  "Configured
library directories" are whatever has been configured in your linker, plus
the arguments to any -L options you might have.

So, putting -lssl on the linker command line will make the linker look for
(for instance) /lib/libssl.so, /lib/libssl.a, /usr/lib/libssl.so,
/usr/lib/libssl.a, /usr/lib/i586-linux/libssl.so,
/usr/lib/i586-linux/libssl.a, /usr/local/lib/libssl.so,
/usr/local/lib/libssl.a, and so forth.  (The system may start looking for .a
(static libraries) only after it's finished looking for .so's in all places,
I can't really remember).

So, since the linker is looking for a file called libssl.so in one of the
usual library directories, you can wander over to
http://packages.debian.org/, scroll to the bottom ("Search the contents of
packages"), type 'libssl.so' in the keyword box, pick your distribution, and
click 'Search'.  That'll tell you that the libssl-dev package contains the
file usr/lib/libssl.so, which solves your problem and makes everything cool.

Wasn't the short answer easier... <grin>

- Matt

--Dzs2zDY0zgkG72+7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBK8a9BEnrTWk1E4cRAs93AJ0blupo6J++EM3zQcse2zdMEXOUFwCeO5L3
1ol7Bpw5sY/OCwgGs6KgR4o=
=kVds
-----END PGP SIGNATURE-----

--Dzs2zDY0zgkG72+7--

--===============0394917641==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
--===============0394917641==--


--=-HQxAxLdi4YoFnFD0vlmJ
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
SLUG Pearls
http://lists.slug.org.au/listinfo/pearls

--=-HQxAxLdi4YoFnFD0vlmJ--

--=-HQxAxLdi4YoFnFD0vlmJ--