|
Home > Archive > Unix administration > March 2004 > Shared Library Question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Shared Library Question
|
|
| Quito Quito 2004-03-10, 9:37 pm |
| Hello, All:
I am trying to build a "shared library" on my Sun Microsystems
machine. I used the following command
% f77 -pic -c betacf.f betai.f gammln.f
to generate three object files and then I used
% ld -o student.so.1.1 -assert pure-text *.o
to generate the final library. But I got the error message
ld: fatal: file pure-text: open failed: No such file or directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^
I followed the Sun FORTRAN User's Guide (Part Number: 800-5302-10,
Revision A of 22 February 1991) exactly.
What does it mean? What's wrong with the above procedures?
Thanks.
Roland
| |
| Alan Coopersmith 2004-03-10, 9:37 pm |
| qquito@hotmail.com (Quito Quito) writes in comp.unix.admin:
|% ld -o student.so.1.1 -assert pure-text *.o
|ld: fatal: file pure-text: open failed: No such file or directory
-assert is not a valid ld flag on any current version of Solaris.
What version of SunOS or Solaris are you trying to run this on?
|I followed the Sun FORTRAN User's Guide (Part Number: 800-5302-10,
|Revision A of 22 February 1991) exactly.
Are you sure that's the correct version for the software version you
are using?
--
________________________________________
________________________________
Alan Coopersmith alanc@alum.calberkeley.org
http://www.CSUA.Berkeley.EDU/~alanc/ aka: Alan.Coopersmith@Sun.COM
Working for, but definitely not speaking for, Sun Microsystems, Inc.
| |
| Paul Pluzhnikov 2004-03-10, 11:34 pm |
| qquito@hotmail.com (Quito Quito) writes:
> % ld -o student.so.1.1 -assert pure-text *.o
> ld: fatal: file pure-text: open failed: No such file or directory
From 'info ld' (the GNU-ld):
`-assert KEYWORD'
This option is ignored for SunOS compatibility.
> I followed the Sun FORTRAN User's Guide (Part Number: 800-5302-10,
> Revision A of 22 February 1991) exactly.
Well, that's a bit dated, isn't it? You are not on SunOS(4) anymore.
Try "ld -G -o student.so.1.1 -z text *.o"
Also, you probably should be using "f77" and not ld to build your
library. Using ld directly very ofthen results in incorrect binaries.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
| |
| Quito Quito 2004-03-11, 2:34 am |
| Yes, it worked and I also tried
% f77 -G -o student.so.1.1 betacf.f betai.f gammln.f
and in both cases, I generated the file student.so.1.1. Then I used
% f77 zzz000.f student.so.1.1 (where zzz000.f is my main program)
to get a file called a.out.
However ...
When I ran the excutable a.out, I got the error message
"ld.so.1: a.out: fatal: student.so.1.1: open failed: No such file or directory
Killed"
What does that mean?
Thank you all very much for your answers.
Roland
Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote in message news:<m3wu5snip6.fsf@salmon.parasoft.com>...
> qquito@hotmail.com (Quito Quito) writes:
>
> ......
> Try "ld -G -o student.so.1.1 -z text *.o"
>
> Also, you probably should be using "f77" and not ld to build your
> library. Using ld directly very ofthen results in incorrect binaries.
| |
| Victor Wagner 2004-03-11, 2:34 am |
| In comp.unix.programmer Quito Quito <qquito@hotmail.com> wrote:
: and in both cases, I generated the file student.so.1.1. Then I used
: % f77 zzz000.f student.so.1.1 (where zzz000.f is my main program)
: to get a file called a.out.
: However ...
: When I ran the excutable a.out, I got the error message
: "ld.so.1: a.out: fatal: student.so.1.1: open failed: No such file or directory
: Killed"
: What does that mean?
It probably means that it doesn't know where to find your shared
library. In Unix executable files (including shared libraries) are not
searched in current directory. And shared libraries are not searched
along executables PATH. You should either
1) set LD_LIBRARY_PATH environment variable to include directory where
your shared library reside
2) add -R option to linker to compile non-statdard shared library path
into a.out
--
| |
| Casper H.S. Dik 2004-03-11, 4:34 am |
| Alan Coopersmith <alanc@alum.calberkeley.org> writes:
>qquito@hotmail.com (Quito Quito) writes in comp.unix.admin:
>|% ld -o student.so.1.1 -assert pure-text *.o
>|ld: fatal: file pure-text: open failed: No such file or directory
>-assert is not a valid ld flag on any current version of Solaris.
>What version of SunOS or Solaris are you trying to run this on?
The "-assert pure-text" option brings back memories of SunOS 4.x.
>|I followed the Sun FORTRAN User's Guide (Part Number: 800-5302-10,
>|Revision A of 22 February 1991) exactly.
That sounds like SunOS 4.x days as well; better check the
only docs at docs.sun.com
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
|
|
|
|
|