1752591 Members
2733 Online
108788 Solutions
New Discussion юеВ

C compiler issue

 
Avinash Sangle
New Member

C compiler issue

ld: Unsatisfied symbols:
$global$ (data) (probably missing /usr/ccs/lib/crt0.o)
Building the independent server mulserv
*** Expect unresolved references similar to:
/usr/ccs/bin/ld: Unsatisfied shared library symbols:


ERROR LOG :

Building the shared library libsmul.sl
+ ld +s +n -o libsmul.sl globref.o mulsvr.o -L. -L/home/tc5/tc5new/support/usc/l
ib -L/home/tc5/tc5new/support/ui/lib -L/home/tc5/tc5new/support/os/lib -L/home/t
c5/tc5new/support/ddb/lib -L/home/tc5/tc5new/support/sm/lib -L/home/tc5/tc5new/s
upport/metadb/lib -L/home/tc5/tc5new/support/csa/lib -L/home/tc5/tc5new/support/
omf/svr -L/home/tc5/tc5new/bin /home/tc5/tc5new/tc5cusdir/lib/libmul.a /home/tc5
/tc5new/tc5cusdir/lib/libmulcl.a -L/home/tc5/tc5new/bin -lsomf -L/home/tc5/tc5ne
w/bin -lslcm -lsocc -lspup -lstkt -lstms -lsxml -lswsm -lswww -lsapc -lsdmm -lsp
fm -lsvis -lsvpd -lsc9t -lscds -lsemg -lsxrf -lsvms -lsmci -lsedt -lsccf -lscms
/home/tc5/tc5new/support/omf/lib/libsvu.a -lsusc -lsuim -lsos -lsddb -lssm -lsme
tc -lscsa -lm -lc
ld: Unsatisfied symbols:
$global$ (data) (probably missing /usr/ccs/lib/crt0.o)
Building the independent server mulserv
*** Expect unresolved references similar to:
/usr/ccs/bin/ld: Unsatisfied shared library symbols:
U_update_state_vector (code)
U_get_shLib_unw_tbl (code)
U_resume_execution (code)
__StaticCtorTable_Start (data)
U_get_previous_frame_x (code)
U_get_unwind_table (code)
__ZStaticCtorTable_End (data)
__StaticCtorTable_End (data)
U_get_shLib_text_addr (code)
U_get_unwind_entry (code)
__ZStaticCtorTable_Start (data)

+ cc -Wl,-O -Wl,+vshlibunsats,+s,+n,-Bimmediate,-Bnonfatal -o mulserv /home/tc5/
tc5new/support/omf/svr/svrcmain.o mulserv.o -L. -L/home/tc5/tc5new/support/usc/l
ib -L/home/tc5/tc5new/support/ui/lib -L/home/tc5/tc5new/support/os/lib -L/home/t
c5/tc5new/support/ddb/lib -L/home/tc5/tc5new/support/sm/lib -L/home/tc5/tc5new/s
upport/metadb/lib -L/home/tc5/tc5new/support/csa/lib -L/home/tc5/tc5new/support/
omf/svr -L/home/tc5/tc5new/bin mulsvr.o -lsmul -lsomf /home/tc5/tc5new/support/o
mf/lib/libsvu.a -lsusc -lsuim -lsos -lsddb -lssm -lsmetc -lscsa -lm
(Warning) Optimizing ADDILs in the presence of the debug information. Debug info
rmation may be corrupted (1594)
/usr/ccs/bin/ld: Unsatisfied symbols:
_mulDCap0UpdValidateDialog (first referenced in mulsvr.o) (code)
_mulm0SmcDwgm0CreMulDwgFromSmcDg (first referenced in mulsvr.o) (code)
_mulDPer0UpdProcessDialog (first referenced in mulsvr.o) (code)
_mulDCap0CreProcessDialog (first referenced in mulsvr.o) (code)
_mulGnRqAcItm0GenChItmReport (first referenced in mulsvr.o) (code)
_mulm0MulDwgDoRevisePre (first referenced in mulsvr.o) (code)
_mulDCap0CreValidateDialog (first referenced in mulsvr.o) (code)
_mulDCap0UpdSetDialogDefaults (first referenced in mulsvr.o) (code)
_mulDPer0UpdSetDialogDefaults (first referenced in mulsvr.o) (code)
_mulm0MulDwgDoRevisePost (first referenced in mulsvr.o) (code)
_mulDPer0CreProcessDialog (first referenced in mulsvr.o) (code)
_mulDDgMRevm0GetSpLegValSmcDrg (first referenced in mulsvr.o) (code)
_mulDPer0UpdValidateDialog (first referenced in mulsvr.o) (code)
_mulDCap0CreSetDialogDefaults (first referenced in mulsvr.o) (code)
_mulDPer0CreSetDialogDefaults (first referenced in mulsvr.o) (code)
_mulDDgMGetIm0ShowEcnEcrStatus (first referenced in mulsvr.o) (code)
_mulDPer0CreValidateDialog (first referenced in mulsvr.o) (code)
_mulm0DwgDocm0ChkSmc2MulDgExist (first referenced in mulsvr.o) (code)
_mulDCap0UpdProcessDialog (first referenced in mulsvr.o) (code)
_mulDDgMRevSetDialogDefaults (first referenced in mulsvr.o) (code)
_mulDDgMRevm0GetSpLVMulEcnEcr (first referenced in mulsvr.o) (code)
s
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: C compiler issue

This isn't a compiler issue; it's a linker issue. At least for some of these, you need to add libcl.

Here's an approach that can be used to solve the general case of this problem:

1) Create a textfile that contains the symbol list from all libraries:

nm /usr/lib/lib* > mysymlist

2) Examine this text file for the undefined symbols:

vi mysymlist

You would search for "U_update_state_vector", for example. When you find the actual code your then do
a "? Symbols from" reverse search in vi and that will tell you the actual library name.

Learn this technique and you shouldn't have to ask this question again.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: linker unsat problem

There are several things wrong here. The first is that you MUST use aCC -b to link aC++ shared libs. You can NOT use ld directly, or the C driver cc.

Also for aC++, you must NOT use the linker's -O option. (The warning (1594).)

You neglected to pass -b to the cc driver to pass on to ld. (This may be the real issue.)

When creating aC++ shlibs, you must following the directions on:
http://www.docs.hp.com/en/7762/5991-4874/distributing.htm#linking

If the intention of the comment "*** Expect unresolved references similar to" is to ignore unsats, perhaps you should not use +vshlibunsats.

Clay is right that you need -lcl to define some of the symbols. But an easier way to find the library that defines the symbols is to use:
$ nm -pxAN /usr/lib/lib*

The -A option prints the name of the lib with the symbol.

Avinash Sangle
New Member

Re: C compiler issue

Thanks Clay & Dennis. Will check and revert back soon.