Library not found


A

Andrea Crotti

I get this error trying to load a library:
--8<---------------cut here---------------start------------->8---
Cannot open shared library 'libwifi-fw.so'.
--8<---------------cut here---------------end--------------->8---

This error is given by "my" code, but looking with strace more in depth
I see

--8<---------------cut here---------------start------------->8---
open("./libwifi-fw.so", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 '\0\0\0\0\0\0"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0755, st_size=198677, ...}) = 0
getcwd("/root/inet/examples/adhoc/ieee80211_wififw", 128) = 43
mmap(NULL, 2115672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7facfbf48000
mprotect(0x7facfbf4d000, 2093056, PROT_NONE) = 0
mmap(0x7facfc14c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x4000) = 0x7facfc14c000
close(4) = 0
munmap(0x7facfbf48000, 2115672) = 0
open("../libwifi-fw/.libs/libwifi-fw.so", O_RDONLY) = -1 ENOENT (No such file or directory)
--8<---------------cut here---------------end--------------->8---

So in short
- the library is found
- it does something which probably get an error
- it close it again and it continues not finding anything else useful

Any idea of what could be the problem?
(the permissions are correct apparently)
 
Ad

Advertisements

V

Victor Bazarov

I get this error trying to load a library:
--8<---------------cut here---------------start------------->8---
Cannot open shared library 'libwifi-fw.so'.
--8<---------------cut here---------------end--------------->8---

This error is given by "my" code, but looking with strace more in depth
I see

--8<---------------cut here---------------start------------->8---
open("./libwifi-fw.so", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 '\0\0\0\0\0\0"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0755, st_size=198677, ...}) = 0
getcwd("/root/inet/examples/adhoc/ieee80211_wififw", 128) = 43
mmap(NULL, 2115672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7facfbf48000
mprotect(0x7facfbf4d000, 2093056, PROT_NONE) = 0
mmap(0x7facfc14c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x4000) = 0x7facfc14c000
close(4) = 0
munmap(0x7facfbf48000, 2115672) = 0
open("../libwifi-fw/.libs/libwifi-fw.so", O_RDONLY) = -1 ENOENT (No such file or directory)
--8<---------------cut here---------------end--------------->8---

So, when you try to load a library (using what standard C++ function?)
you get an error. The library is apparently missing. Where? Could it
be that your "current directory" is different than what the loader expects?

Anyway, that is *not* a language problem, it's your OS problem.
Consider posting to the newsgroup catering to your OS.
So in short
- the library is found
- it does something which probably get an error
- it close it again and it continues not finding anything else useful

Any idea of what could be the problem?

Yes. Wrong newsgroup.

V
 
M

Marc

Andrea said:
I get this error trying to load a library:
--8<---------------cut here---------------start------------->8---
Cannot open shared library 'libwifi-fw.so'.
--8<---------------cut here---------------end--------------->8--- [...]
So in short
- the library is found
- it does something which probably get an error
- it close it again and it continues not finding anything else useful

Any idea of what could be the problem?
(the permissions are correct apparently)

32 bits vs 64 bits? By the way, this doesn't have anything to do with
C++, a newsgroup on your OS would be a better choice.
 
A

Andrea Crotti

Marc said:
32 bits vs 64 bits? By the way, this doesn't have anything to do with
C++, a newsgroup on your OS would be a better choice.

well it does the same with two machines, but actually they're both
64bits linux now that I think.

What difference can the 64 libraries make?
I'll ask somewhere else maybe then..
 
Ad

Advertisements

A

Andrea Crotti

well it does the same with two machines, but actually they're both
64bits linux now that I think.

What difference can the 64 libraries make?
I'll ask somewhere else maybe then..

Solved, actually it was in some way a c++ problem (or at least "trap").
In the compilation I had a header included with some extern, but I
didn't include the corresponding cpp file.

So it could not find the symbols but actually it was complaining for
other things, it was quite hard to trace the real issue...
 

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

Top