Operating System - HP-UX
1834149 Members
2298 Online
110064 Solutions
New Discussion

Re: Linker error: Unsatisfied symbols

 
Sanjib Talukdar
Occasional Advisor

Linker error: Unsatisfied symbols

All,
We are using the following command to build an executable on HP UX 11.0.
aCC -W l,-z -W l,-Bimmediate -W l,-Bnonfatal -W l,+s -Wl,-a,archive CSTARCallBack.o CSTARDisplay.o CSTARServer.o CSTARToXdr.o ChangeOE.o RestorSvc.o ChangeLnFeat.o ChangeIntrcpt.o TransFileMgr.o tbcc.o /prod/ssi/ssi-3.18/dg/dev/xdr/libidl.a /prod/ssi/ssi-3.18/dg/dev/lib/libDG.a /prod/ssi/ssi-3.18/dg/dev/lib/libOSSGW.a /prod/ssi/ssi-3.18/dg/rogue/lib/libtls0s.a /prod/ssi/ssi-3.18/dg/dev/xdr/libidl.a /prod/ssi/ssi-3.18/dg/dev/lib/libpwd.a -L/opt/datagate/lib -L/opt/datagate/rsa/tipemlib/hp9000/lib -lsinfra -lsclass -laclapi -lUtil -lInfra -lpksec -lTipemCS -lLLCache -ltipemutl -ltipem -ldgsnmp -lRawMsg -lMdrivers -lLinklist -lavl -lxdr -Wl,-a,default -lm -lrwtool -ldce -lndbm -ldld -lc_r -I. -I/opt/CC/include/CC -I/opt/datagate/include -I/opt/datagate/include/security -I/usr/include/reentrant -I/usr/include -I/prod/ssi/ssi-3.18/dg/rogue -I/prod/ssi/ssi-3.18/dg/dev/xdr -I/prod/ssi/ssi-3.18/dg/dev/include -I/prod/ssi/ssi-3.18/dg/dev/src/libOSSGW -I/prod/ssi/ssi-3.18/dg/dev/src/libDG -o CSTARServer-6.0.1

I am getting the "/usr/ccs/bin/ld: Unsatisfied symbols:" error. Some of the symbols for which I am getting the error are
xdr_TbccReq_t() (first referenced in tbcc.o) (code)
xdr_ChangeIntrcptReq_t() (first referenced in ChangeIntrcpt.o) (code)
xdr_getErrorResp_t() (first referenced in /prod/ssi/ssi-3.18/dg/dev/lib/libOSSGW.a(Exception.o)) (code)

These symbols are part of the libidl.a archive and is to be included in building the executable. The library has been specified in the build command line above.

Please can anyone clarify why these errors are occurring? The libidl.a is built from *.o files using the command ar rc .
The versions of the tools are
/opt/aCC/bin/aCC:
$Revision: 92453-07 linker linker crt0.o B.11.30 020412 $
HP aC++ B3910B A.03.45
HP aC++ B3910B A.03.33 Language Support Library

/usr/ccs/bin/ld:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
HP aC++ B3910B X.03.37.01 Classic Iostream Library
HP aC++ B3910B X.03.37.01 Language Support Library
ld_msgs.cat: $Revision: 1.85 $
92453-07 linker command s800.sgs ld PA64 B.11.38 REL 031217

/usr/ccs/bin/ar:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
HP aC++ B3910B X.03.37.01 Classic Iostream Library
HP aC++ B3910B X.03.37.01 Language Support Library
ar.cat: $Revision: 1.0 $
92453-07 linker command s800.sgs ar PA64 B.11.38 REL 031217

4 REPLIES 4
ranganath ramachandra
Esteemed Contributor

Re: Linker error: Unsatisfied symbols

can you add this to your link line and post the linker output: -Wl,-y,xdr_TbccReq_t (or any other symbol name which is shown as unresolved)

btw there is a known issue with that version B.11.38 of the linker (not related to this problem) so you may want to upgrade to 11.40 - PHSS_30965 (11.00) / PHSS_30966 (11.11).
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

R. Allan Hicks
Trusted Contributor

Re: Linker error: Unsatisfied symbols

One of the annoying problems that I noticed in the early days of HP-UX was backward references. I apologize for my ignorance if this problem has been fixed. I've noted a lot of patches to ld over the years so this may be an non-issue.....

In the days of old, if library A contained a reference to a routine contained in library B, and library B contained a reference back to library A a linker problem could occur.

libA

void foo_a(){

foo_c();

}

void foo_b(){
}

libB

void foo_c(){
foo_b();
}

When the linker searches libA to resolve a call to foo_a, it picksup an unresolved call to foo_c. If no one has called foo_b yet, then the linker doesn't care about foo_b.

When it searches libB, it resolves the call to foo_c, and picks up an unresolved call to foo_b (a backward reference) which cannot be resolved unless it searches libA again.

This is (or was) why my OEM has the same libraries listed multiple times in their makefile (or so they tell me).

hrmph... in the old 16 bit days the RTE-linker handled backward reference just fine.

In any event, you might try reordering your libraries or repeating them to see if it resolves. If it does, then the backward reference problem must still be out there.

--Good Luck
"Only he who attempts the absurd is capable of achieving the impossible
ranganath ramachandra
Esteemed Contributor

Re: Linker error: Unsatisfied symbols

that problem can be overcome with the linker's +n option, passed through the compiler as -Wl,+n .
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Sanjib Talukdar
Occasional Advisor

Re: Linker error: Unsatisfied symbols

All,
Thank you for your replies and effort to help out.
We found that the problem is being caused by rpcgen which is generating the xdr_*** functions from *.x files in our component. Without the -C option, rpcgen on HP UX 11.00 does NOT generate ANSI compliant stubs i.e. the xdr_*** functions are NOT declared within extern "C" { } block in the generated *.h files. This was NOT the case on HP UX 10.20. This was the root of the problem since the component is built using the CC compiler as the rest of the source code is in C++.