Linking in a module?

T

Trespasser

Hi,

When I try to execute a program called cnet I get an error like:

[root@duenna stopandwait]$ cnet -s -m 1 STOPANDWAIT
cnet: error while loading shared libraries: libelf.so.0: cannot open shared
object file: No such file or directory

I think that means that the runtime loader can't find a file to link with
the cnet program. I do have the file libelf.so.0 in /usr/local/lib, but I've
tried and can't find a way to tell the loader to look there.

Am I able to link the missing module to the executable when I compile the
program? I think my linker options should include -llibelf, but when I
include that the ld program say's it can't find libelf. I could help it to
find what it's looking for with -Lsomepath I guess, but I don't know what
the loader is looking for. Surely not libelf.so.0. Tried that, didn't go.

Can anyone please tell me what I'm doing. I have no clue.

Regards,
Muz.
 
R

red floyd

Trespasser said:
Hi,

When I try to execute a program called cnet I get an error like:

[root@duenna stopandwait]$ cnet -s -m 1 STOPANDWAIT
cnet: error while loading shared libraries: libelf.so.0: cannot open shared
object file: No such file or directory

I think that means that the runtime loader can't find a file to link with
the cnet program. I do have the file libelf.so.0 in /usr/local/lib, but I've
tried and can't find a way to tell the loader to look there.

Am I able to link the missing module to the executable when I compile the
program? I think my linker options should include -llibelf, but when I
include that the ld program say's it can't find libelf. I could help it to
find what it's looking for with -Lsomepath I guess, but I don't know what
the loader is looking for. Surely not libelf.so.0. Tried that, didn't go.

Can anyone please tell me what I'm doing. I have no clue.

What, specifically was your C++ question?

Linking and loading are off-topic and are highly system dependent. I
would recommend asking again in comp.unix.programmer.

F/U set.
 
G

Gianni Mariani

Trespasser wrote:
....
Can anyone please tell me what I'm doing. I have no clue.

As already noted by Red, this is OS specific.

Look up LD_LIBRARY_PATH and documentation on the "dynamic loader" or on
Linux, ld.so.

Why would your libelf be in a non searched location ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,649
Latest member
MargaretCo

Latest Threads

Top