Can't read shared library
-
- User
- Posts: 83
- Joined: Mon May 16, 2005 4:19 pm
- Location: St. Louis, MO
Can't read shared library
Hi all,
I talked to the author of my astronomy program and he showed me how to use the source code to make a shared library which is named 'libastro.so" I also have the libastro.a available.
Anyway, when I try to open the file with pb, it says it cannot open the file. I have opened several other files and was able to read the functions and cannot see why this won't open. The permissions seem the same.
Here is the opening program:
EnableDebugger
result.l=OpenLibrary(1,"libastro.so")
ExamineLibraryFunctions(1)
Debug result
While NextLibraryFunction() <>0
Debug LibraryFunctionName()
Wend
CloseLibrary(1)
I am getting a 0(false) back as result, but cannot figure out why.
Any ideas?
I talked to the author of my astronomy program and he showed me how to use the source code to make a shared library which is named 'libastro.so" I also have the libastro.a available.
Anyway, when I try to open the file with pb, it says it cannot open the file. I have opened several other files and was able to read the functions and cannot see why this won't open. The permissions seem the same.
Here is the opening program:
EnableDebugger
result.l=OpenLibrary(1,"libastro.so")
ExamineLibraryFunctions(1)
Debug result
While NextLibraryFunction() <>0
Debug LibraryFunctionName()
Wend
CloseLibrary(1)
I am getting a 0(false) back as result, but cannot figure out why.
Any ideas?
John R. Duchek
St. Louis,MO
St. Louis,MO
-
- User
- Posts: 83
- Joined: Mon May 16, 2005 4:19 pm
- Location: St. Louis, MO
yes, I think so...
It is in the same folder as the program and also in the userlib directory under purebasic. Its length is 450138 bytes and its permissions/ownership are
-rw-r--r-- 1 john users
john is the logged in user who is running purebasic.
-rw-r--r-- 1 john users
john is the logged in user who is running purebasic.
John R. Duchek
St. Louis,MO
St. Louis,MO
-
- User
- Posts: 83
- Joined: Mon May 16, 2005 4:19 pm
- Location: St. Louis, MO
chmod 777
I did it and it made no difference. I am still getting a refusal to open the file. (result =0) The file isn't garbage, I can load it in an editor, and while it isn't text, I can see there are addresses, and routine names and such.
;-(
John
;-(
John
John R. Duchek
St. Louis,MO
St. Louis,MO
-
- User
- Posts: 83
- Joined: Mon May 16, 2005 4:19 pm
- Location: St. Louis, MO
library copy
Hi,
I sure can, just give me an email address.
I have also found a difference between this file and some that load. When I tried to load libxine.so.1 by reading it with less, it says
==> This is a dynamic library, showing the output of nm
nm: libxine.so.1: no symbols
and pb loads it and displays the routines.
with libastro.so it says
==> This is a dynamic library, showing the output of nm
0006bde0 b Args
000693f8 b CosLat.5361
000694c0 b CosPenumbra
0006bd50 b D1.4085
0006bd4c b D2.4086
0006bd48 b D3.4087
0006bd44 b D4.4088
00017f70 t E0000
0006be80 b Ea_arcsec
00069448 b Eccentricity
00069440 b EpochArgPerigee
00069410 b EpochDay
00069418 b EpochMeanAnomaly
00069420 b EpochOrbitNum
00069428 b EpochRAAN
00069408 b G1.5359
00069400 b G2.5360
00069450 b Inclination
000148f0 t Kepler
0006be70 b LP_equinox
0006be78 b NF_arcsec
00037328 d OldSiteElevation.5364
Could the symbol table be a problem? If so, how do I compile it without it?
John
I sure can, just give me an email address.
I have also found a difference between this file and some that load. When I tried to load libxine.so.1 by reading it with less, it says
==> This is a dynamic library, showing the output of nm
nm: libxine.so.1: no symbols
and pb loads it and displays the routines.
with libastro.so it says
==> This is a dynamic library, showing the output of nm
0006bde0 b Args
000693f8 b CosLat.5361
000694c0 b CosPenumbra
0006bd50 b D1.4085
0006bd4c b D2.4086
0006bd48 b D3.4087
0006bd44 b D4.4088
00017f70 t E0000
0006be80 b Ea_arcsec
00069448 b Eccentricity
00069440 b EpochArgPerigee
00069410 b EpochDay
00069418 b EpochMeanAnomaly
00069420 b EpochOrbitNum
00069428 b EpochRAAN
00069408 b G1.5359
00069400 b G2.5360
00069450 b Inclination
000148f0 t Kepler
0006be70 b LP_equinox
0006be78 b NF_arcsec
00037328 d OldSiteElevation.5364
Could the symbol table be a problem? If so, how do I compile it without it?
John
John R. Duchek
St. Louis,MO
St. Louis,MO
-
- User
- Posts: 83
- Joined: Mon May 16, 2005 4:19 pm
- Location: St. Louis, MO
Nope
after the 777 it was executable. Even so I went ahead and gave it the +x.
It still doesn't load. I noted that the source file for pb wasn't executable so I gave it the +x too. Still doesn't work.
John
It still doesn't load. I noted that the source file for pb wasn't executable so I gave it the +x too. Still doesn't work.
John
John R. Duchek
St. Louis,MO
St. Louis,MO
-
- Addict
- Posts: 2345
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
did you try a :
Code: Select all
chown john:john libastro.so
“Fear is a reaction. Courage is a decision.” - WC
Do you resolve your problem with ? :
Code: Select all
result.l=OpenLibrary(1,"./libastro.so")
Sounds silly, but try to set FULL (absolute) path to the lib, like: "/usr/lib/libastro.so".
I had same problem with a lib a few days ago. And not every.
I know, it's dirty but it might work. I've already got some problems with the LD_PATH variable unter PB-Linux, but don't know why.
I had same problem with a lib a few days ago. And not every.
I know, it's dirty but it might work. I've already got some problems with the LD_PATH variable unter PB-Linux, but don't know why.
cheers,
bembulak
bembulak