Can't read shared library

Linux specific forum
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

Can't read shared library

Post by John Duchek »

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?
John R. Duchek
St. Louis,MO
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

where is the lib located?
Is it in the same directory as the source?
If not try a absolute path to check if it's not a path problem... otherwise does the lib have a filesize > 0?
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Permissions of the Lib correct ?
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

yes, I think so...

Post by John Duchek »

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.
John R. Duchek
St. Louis,MO
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

try "chmod 777 filename" I don't see an excutable bit set
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

chmod 777

Post by John Duchek »

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 R. Duchek
St. Louis,MO
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

can you provide the lib (must not be as download in this forum ; maybe by mail) that someone could have a look at?
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

library copy

Post by John Duchek »

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
John R. Duchek
St. Louis,MO
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

try chmod +x filename.
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

Nope

Post by John Duchek »

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
John R. Duchek
St. Louis,MO
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Same problem here. I can't read my .so files created with PB.
bye,
Daniel
Anonymous

Post by Anonymous »

try this :

Code: Select all

result.l=OpenLibrary(1,"./libastro.so")
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

did you try a :

Code: Select all

chown john:john libastro.so
“Fear is a reaction. Courage is a decision.” - WC
Anonymous

Post by Anonymous »

Do you resolve your problem with ? :

Code: Select all

result.l=OpenLibrary(1,"./libastro.so")
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 575
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

Post by bembulak »

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.
cheers,

bembulak
Post Reply