HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Linking program with libraries
Operating System - HP-UX
1829347
Members
4738
Online
109991
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 03:58 AM
11-13-2002 03:58 AM
Linking program with libraries
I get a list of 14 unsatisfied externals when I try to link a program with two subroutine-libraries. If I, as a test, omit the libraries the list will be about 75 unsatisfied externals.
It seems (to me) that the linker manages to find some subroutines but not all. The missing subroutines are referenced from either the main program or one of the libraries.
The program and the library subroutines are written in Fortran77 or C.
Compiling of library subroutine:
f90 -c -O -K -DAportable +U77 +ppu -o abbcor.o abbcor.F
cc -c -O -DAportable -Aa -D_HPUX_SOURCE -D_NO_PROTO -DSYSV -I/usr/include/X11R5 -o tsdrve.o tsdrve.c
Making the libraries:
ar rv libjack.a abbcor.o
ar rv c08.a tsdrve.o
ranlib libjack.a
Linking program:
f90 -Wl,-aarchive_shared -L/usr/lib/X11R5 -lm -O -o jackal jackal.o libjack.a c08.a
It seems (to me) that the linker manages to find some subroutines but not all. The missing subroutines are referenced from either the main program or one of the libraries.
The program and the library subroutines are written in Fortran77 or C.
Compiling of library subroutine:
f90 -c -O -K -DAportable +U77 +ppu -o abbcor.o abbcor.F
cc -c -O -DAportable -Aa -D_HPUX_SOURCE -D_NO_PROTO -DSYSV -I/usr/include/X11R5 -o tsdrve.o tsdrve.c
Making the libraries:
ar rv libjack.a abbcor.o
ar rv c08.a tsdrve.o
ranlib libjack.a
Linking program:
f90 -Wl,-aarchive_shared -L/usr/lib/X11R5 -lm -O -o jackal jackal.o libjack.a c08.a
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 04:51 AM
11-13-2002 04:51 AM
Re: Linking program with libraries
why not 'ranlib c08.a' ?
Hmm, shared archives requested, static archives made ...
f90 -c -O .... +Z blah.F
cc -c -O .... +Z -o foo.c
ld -b -o blah.sl blah.o
ld -b -o foo.sl foo.o
f90 -L. -L/usr/... -o jackal jackal.o -lblah -lfoo
Hmm, shared archives requested, static archives made ...
f90 -c -O .... +Z blah.F
cc -c -O .... +Z -o foo.c
ld -b -o blah.sl blah.o
ld -b -o foo.sl foo.o
f90 -L. -L/usr/... -o jackal jackal.o -lblah -lfoo
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 04:52 AM
11-13-2002 04:52 AM
Re: Linking program with libraries
Last had -o too many, soory ...
f90 -c -O .... +Z blah.F
cc -c -O .... +Z foo.c
ld -b -o blah.sl blah.o
ld -b -o foo.sl foo.o
f90 -L. -L/usr/... -o jackal jackal.o -lblah -lfoo
f90 -c -O .... +Z blah.F
cc -c -O .... +Z foo.c
ld -b -o blah.sl blah.o
ld -b -o foo.sl foo.o
f90 -L. -L/usr/... -o jackal jackal.o -lblah -lfoo
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 02:12 AM
11-14-2002 02:12 AM
Re: Linking program with libraries
Hi!
Thank you procura for the answer!
There still is something wrong, however...
I have recompiled all routines in both libraries with the +Z option both for f90 and cc compilers and I have changed the extension for the libraries to .sl (instead of .a) and I use "ld -b -o" (instead of "ar rv") to enter the subroutines into the libraries, but now no library subroutine at all is loaded in the program, at least there is a very long list of unsatisfied externals.
I have tried to load the program with f90 or aCC (even if there are no C++ routines in this program) with the same result.
Thank you procura for the answer!
There still is something wrong, however...
I have recompiled all routines in both libraries with the +Z option both for f90 and cc compilers and I have changed the extension for the libraries to .sl (instead of .a) and I use "ld -b -o" (instead of "ar rv") to enter the subroutines into the libraries, but now no library subroutine at all is loaded in the program, at least there is a very long list of unsatisfied externals.
I have tried to load the program with f90 or aCC (even if there are no C++ routines in this program) with the same result.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP