- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ld: Unsatisfied symbols
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
04-17-2003 05:31 AM
04-17-2003 05:31 AM
ld: Unsatisfied symbols
aCC: HP ANSI C++ B3910B A.03.31
ld: 92453-07 linker linker ld B.11.33 020617
I'm building a shared library. Everything seems to work properly. However, if I use the -v (verbose) option on the ld command line, I receive a warning that there are several unsatistied symbols. For example:
ld: Unsatisfied symbols:
memset (first referenced in foo.o) (code)
memcpy (first referenced in bar.o) (code)
atoi (first referenced in foo.o) (code)
toupper (first referenced in foo.o) (code)
strlen (first referenced in foo.o) (code)
_isspace (first referenced in foo.o) (code)
I'm a little confused because these are standard C functions. I've tried various library combinations (-lblah) with both aCC and ld with no success.
I've searched through the libraries in /usr/lib with nm for memset (the first reference). nm on libc.a produces the following results:
memset.o:
U __SYSTEM_ID
000000a0 T __memset20
00000180 T __memsetfp
00000000 T _memset
00000030 t endfil
00000270 t exit_fp
0000002c t filend
000001d0 t main_memset_fp
000000f0 t main_pa20
00000000 W memset
000000a0 t memset_pa20
0000024c t memset_start_fp
I'm guessing that the "W" for memset is "weak" and that's why ld is complaining.
I'd like to get a "clean" compile -- no warning messages. Is there anything I can do to fix this?
Thanks,
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 06:04 AM
04-17-2003 06:04 AM
Re: ld: Unsatisfied symbols
export LD_LIBRARY_PATH=/usr/lib
To split a simple compilation into two phases do the above then type:
cc -c myprog.c
ld /opt/langtools/lib/crt0.o -o myprog myprog.o -u main -lc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 06:06 AM
04-17-2003 06:06 AM
Re: ld: Unsatisfied symbols
You might be able to get rid of them from the verbose linker output by including the +vnocompatwarnings option.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 06:06 AM
04-17-2003 06:06 AM
Re: ld: Unsatisfied symbols
Yes, these are standard C functions. They are defined in libc.a (archive version) and libc.sl (shared version).
I guess these warnings will disapear if you use the libc library during linkage (I guess for creating of shared library it is not added by default, like in executable).
If you use libc.a the complete library will be added as a part of your library, so I do not recommend it. But if you use libc.sl, this library will be added to the list of libraries requeired by your library to run and the linker will be able to confirm the existance of the functions (so it should stop complaining).
I really understand the desire for 'clean' making. :)
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 06:09 AM
04-17-2003 06:09 AM
Re: ld: Unsatisfied symbols
To make a shared library out of myprog.c I just did this:
cc -c +z myprog.c
ld -b -o myprog.sl myprog.o -lc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 06:53 AM
04-17-2003 06:53 AM
Re: ld: Unsatisfied symbols
Compile:
aCC -c +z foo.cpp -lc -o foo.o
aCC -c +z bar.cpp -lc -o bar.o
Link:
ld -v -b -o foobar.sl foo.o bar.o
--or--
ld -v -b -o foobar.sl -lc foo.o bar.o
I've tried setting LD_LIBRARY_PATH - no change
I've tried +vnocompatwarnings - no change
if I use the second link option above (explicitly stating the library, I still get the unsatisfied symbols, but I also get a section called "unsatisfied shared library symbols"
Steve -- Just for laughs, add a -v to your ld line and see if you receive the same unsatisfied symbols message. You may want to use one of the functions that I listed above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 07:03 AM
04-17-2003 07:03 AM
Re: ld: Unsatisfied symbols
I accidentally went into Linux mode with the environment variable, on HP-UX it is LPATH, not LD_LIBRARY_PATH.
As for your suggestion, this is what I get:
$ rm t2.sl
$ ld -v -b -o t2.sl t2.o -u main -lc
ld -l:libbwiz.sl +vnocompatwarnings +k -v -b -o t2.sl t2.o -lc
LPATH is : /usr/lib:/opt/langtools/lib
Searching library /usr/lib/libbwiz.sl:
Loading t2.o:
Searching library /usr/lib/libdld.2:
Searching library /usr/lib/libc.sl:
Searching library /usr/lib/milli.a:
$ ll t2.sl
-rwxrwxr-x 1 dba dev 20480 Apr 17 15:59 t2.sl
The libbwiz you can ignore since it is a 3rd party library we use.
Without the -v I get no output at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2003 02:09 AM
07-29-2003 02:09 AM
Re: ld: Unsatisfied symbols
but what are you trying to achieve with the -v option of linker ?
--
ranga