Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

library.os.n problem: "cannot open shared object file: Error 40"

4,005 views
Skip to first unread message

Alan Mackenzie

unread,
Feb 16, 2009, 11:55:09 AM2/16/09
to
Having almost installed a new bit of software, I get this message:

"error while loading shared libraries: libedit.so.0: cannot open shared
object file: Error 40."

I'd be very grateful if somebody could tell me
(i) What this message means.
(ii) Where the mailing list is where I could ask the responsible hacker
to substitute something courteous for "Error 40".
(iii) The location of concise, well-written documentation on how to USE
libraries.so (as contrasted with how to create them).

My system is Gentoo (last year's) onto which I've just done
"emerge libedit". ["emerge" is Gentoo's command meaning "please install
the following thing, downloading it from a Gentoo repository.]

"emerge libedit" installed libedit.so, but did not create a symbolic link
libedit.so.0 to it. I created this symlink by hand, and this provoked
the above error message.

--
Alan Mackenzie (Nuremberg, Germany).

Darren Salt

unread,
Feb 16, 2009, 2:06:11 PM2/16/09
to
I demand that Alan Mackenzie may or may not have written...

> Having almost installed a new bit of software, I get this message:

> "error while loading shared libraries: libedit.so.0: cannot open shared
> object file: Error 40."

Probably ELOOP, which means "too many symbolic links encountered" (i.e.
redirected once too often).

[snip]


> My system is Gentoo (last year's) onto which I've just done "emerge
> libedit". ["emerge" is Gentoo's command meaning "please install the
> following thing, downloading it from a Gentoo repository.]

> "emerge libedit" installed libedit.so, but did not create a symbolic link
> libedit.so.0 to it. I created this symlink by hand, and this provoked the
> above error message.

Well done! You now have two symlinks pointing at each other.

(What was the error before? Error 2?)

libedit.so should be a symlink to libedit.so.0, which in turn should be a
symlink to libedit.so.0.0 (the actual filename may not match that, but it
will have at least two numeric components).

(I have libedit.so → libedit.so.2 → libedit.so.2.11.)

--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + At least 4000 million too many people. POPULATION LEVEL IS UNSUSTAINABLE.

Most of us have been at work for several hours now.

Alan Mackenzie

unread,
Feb 16, 2009, 4:41:07 PM2/16/09
to
Darren Salt <ne...@youmustbejoking.demon.cu.invalid> wrote:
> I demand that Alan Mackenzie may or may not have written...

>> Having almost installed a new bit of software, I get this message:

>> "error while loading shared libraries: libedit.so.0: cannot open shared
>> object file: Error 40."
>
> Probably ELOOP, which means "too many symbolic links encountered" (i.e.
> redirected once too often).

Er, yes. Thank you! Wouldn't it be nice if the error message could
have said "libedit.so.0: too many symlinks"?

> [snip]
>> My system is Gentoo (last year's) onto which I've just done "emerge
>> libedit". ["emerge" is Gentoo's command meaning "please install the
>> following thing, downloading it from a Gentoo repository.]

>> "emerge libedit" installed libedit.so, but did not create a symbolic link
>> libedit.so.0 to it. I created this symlink by hand, and this provoked the
>> above error message.

> Well done! You now have two symlinks pointing at each other.

Such intimacy doesn't exist on my system! In /usr/lib I had

libedit.so.0 -> /usr/lib/libedit.so.0

which is just as bad, but emphasises simplicity. ;-)

Having corrected this, the new bit of software (actually the Glasgow
Haskell Compiler) has now run. :-)

> (What was the error before? Error 2?)

Before, I had a "can't find library" error.

> libedit.so should be a symlink to libedit.so.0, which in turn should be a
> symlink to libedit.so.0.0 (the actual filename may not match that, but it
> will have at least two numeric components).

Then there's something up with Gentoo. When I downloaded it (with
emerge), there were precisely two files and no symlinks, libedit.a and
libedit.so. Are the version numbers, the 0 and 2 in libedit.so.0.2
contained within the file in any way, or are they purely part of the
filename?

> (I have libedit.so ? libedit.so.2 ? libedit.so.2.11.)

Ah well, I've got what I need working. Again, many thanks!

Darren Salt

unread,
Feb 17, 2009, 7:22:30 AM2/17/09
to
I demand that Alan Mackenzie may or may not have written...

> Darren Salt <ne...@youmustbejoking.demon.cu.invalid> wrote:
>> I demand that Alan Mackenzie may or may not have written...
>>> Having almost installed a new bit of software, I get this message:
>>> "error while loading shared libraries: libedit.so.0: cannot open shared
>>> object file: Error 40."
>> Probably ELOOP, which means "too many symbolic links encountered" (i.e.
>> redirected once too often).

> Er, yes. Thank you! Wouldn't it be nice if the error message could
> have said "libedit.so.0: too many symlinks"?

Yes. Somebody wants to read strerror(3) and/or perror(3).

[snip]


>> libedit.so should be a symlink to libedit.so.0, which in turn should be a
>> symlink to libedit.so.0.0 (the actual filename may not match that, but it
>> will have at least two numeric components).

> Then there's something up with Gentoo. When I downloaded it (with emerge),
> there were precisely two files and no symlinks, libedit.a and libedit.so.

More likely something up with that particular package.

> Are the version numbers, the 0 and 2 in libedit.so.0.2 contained within the
> file in any way, or are they purely part of the filename?

"libedit.so.0" will be in the file. (You probably want to read up on sonames
and their uses.)

[snip]


--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army

| + Output less CO2 => avoid massive flooding. TIME IS RUNNING OUT *FAST*.

Any Microsoft product is indistinguishable from hardware failure.

0 new messages