Operating System - HP-UX
1753259 Members
4812 Online
108792 Solutions
New Discussion юеВ

Re: Linked in FORTRAN 77 (HP-UX)

 
SOLVED
Go to solution
Roxana_4
Frequent Advisor

Linked in FORTRAN 77 (HP-UX)

My names Roxana and IтАЩm from Romania.

I have a HP9000 system with HP-UX 10.20 and with HP Fortran / 9000 (Fortran 77).

I run the following program text77.f :
program afiseaza
print *,тАЩhelloтАЩ
end

I compile: f77 тАУv text77.f and this is the result :
/usr/lib/77pass1 тАУ text77.f text77.o
text77.f :
MAIN afiseaza
/bin/ld тАУx /lib/crt0.o text77.o тАУlcl тАУlisamstub тАУlc

I perform a.out
$ a.out
and this is the result:
sh : a.out : not found.

I edit the link as follows:
ld тАУv тАУL тАУvallcompatwarnings тАУx /lib/crt0.o text77.o тАУlcl тАУlisamstub тАУlc
The result is
LPATH is : /usr/lib: /opt/langtools/lib
Loading /lib/crt0.o:
Loading text77.o:
Searching library /usr/lib/libdld.1:
Searching library /usr/lib/libisamstub.1:
Searching library /usr/lib/libcl.sl:
Searching library /usr/lib/libisamstub.sl:
Searching library /usr/lib/libc.sl:
Searching library /usr/lib/milli.a:
Loading /usr/lib/milli.a (errnet.o) : errno
Loading /usr/lib/milli.a (div_const.o) :
Loading /usr/lib/milli.a (reml.o) :
Loading /usr/lib/milli.a (dyncallU.o) :
Searching library /usr/lib/milli.a :
ld : Unsatisfied shared lybrary symbols :
main (code)
ld :(Warning) Linker features werw used that may not supported in future releases.

Why?

Thank you and be
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: Linked in FORTRAN 77 (HP-UX)



do this:

./a.out

not

a.out

live free or die
harry d brown jr
Live Free or Die
Roxana_4
Frequent Advisor

Re: Linked in FORTRAN 77 (HP-UX)

Of course ./a.out

Why unsatisfied shared lybrary symbols :
main (code) ?

$ ./a.out
and this is the result:
sh : a.out : not found.

Why ?

Thanks
Roxana_4
Frequent Advisor

Re: Linked in FORTRAN 77 (HP-UX)

Hello Harry.

Sorry for not being clear!

It works if i do "./a.out".
Why does not function if i do "a.out" and returns error "sh: a.out : not found"
Why i receive error message at linkedit? See:
LPATH is : /usr/lib: /opt/langtools/lib
Loading /lib/crt0.o:
Loading text77.o:
Searching library /usr/lib/libdld.1:
Searching library /usr/lib/libisamstub.1:
Searching library /usr/lib/libcl.sl:
Searching library /usr/lib/libisamstub.sl:
Searching library /usr/lib/libc.sl:
Searching library /usr/lib/milli.a:
Loading /usr/lib/milli.a (errnet.o) : errno
Loading /usr/lib/milli.a (div_const.o) :
Loading /usr/lib/milli.a (reml.o) :
Loading /usr/lib/milli.a (dyncallU.o) :
Searching library /usr/lib/milli.a :
ld : Unsatisfied shared lybrary symbols :
main (code)
ld :(Warning) Linker features werw used that may not supported in future releases.

How could i compile or linked in order to make "a.out" work aut ?

Thank you and best regards.
harry d brown jr
Honored Contributor

Re: Linked in FORTRAN 77 (HP-UX)

does /lib/crt0.o have a "main" in it? It doesn't appear to, thus your program text77 needs to be changed to

PROGRAM main
print *,"hello world"
END

live free or die
harry d brown jr
Live Free or Die
Peter Godron
Honored Contributor
Solution

Re: Linked in FORTRAN 77 (HP-UX)

Roxana,
for the a.out to work without ./ you have to have your current directory in $PATH.
Check with "echo $PATH"
If . is missing try "export PATH=$PATH:."
This should fix your a.out problem.
Roxana_4
Frequent Advisor

Re: Linked in FORTRAN 77 (HP-UX)

Many Thanks for help.
Best Regards.

Roxana
Peter Godron
Honored Contributor

Re: Linked in FORTRAN 77 (HP-UX)

Roxana,
always glad to help.
Can you please identify the soultion(s) and close the thread if it was resolved.
Many Thanks
Roxana_4
Frequent Advisor

Re: Linked in FORTRAN 77 (HP-UX)

Thanks Peter Godron, and thanks Harry Brown.
I understand and i resolved.