Operating System - Linux
1748136 Members
3616 Online
108758 Solutions
New Discussion юеВ

Unresolved Symbol:cout__3std (data) while loading shared library

 
Dattesh Lotlikar
Occasional Advisor

Unresolved Symbol:cout__3std (data) while loading shared library

All,
We have a Third Party directory server which allows to load customized plugins .sl files at runtime. When I try to load locally compiled(HP aC++ B3910B A.03.39) shared library(libReader.sl) it throws following error:
aCC runtime: Error 215 from shl_findsym(/usr/local/lib/libLog.sl,_shlInit)
/usr/lib/dld.sl: Unresolved symbol: cout__3std (data) from /usr/local/lib/libLog.sl
/usr/lib/dld.sl: Unresolved symbol: _C_ivals__Q2_4__rw18__rw_numpunct_implXTc_ (data) from /usr/local/lib/libLog.sl
/usr/lib/dld.sl: Unresolved symbol: __rw_std_streams__3std (data) from /usr/local/lib/libLog.sl

Output of file command on Thirparty server gives following:
PA-RISC1.1 shared executable dynamically linked -not stripped

O/P of file command on shared library libReader.sl and libLog.sl:
PA-RISC1.1 shared library -not stripped

ldd on all the executables & shared libraries doesn't throws any errors.

Is this something to do with mismatched version of compiler used by Third party server and locally compiled shared libary?
If so, how do i get around this problem?

Do let me known if you guys have faced such issues before.


Thanks & Regards,
Dattesh Lotlikar
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Unresolved Symbol:cout__3std (data) while loading shared library

Pleast post this output:

echo $SHLIB_PATH

echo $PATH

Make sure $PATH and $SHLIB path include the path of the binaries and the path mentioned in the aforeposted error message.

Also insure that the binaries were compiled on HP-UX and if not, what compiler was used to compile them. You may need to install another compile.

If the software was ported from Linux gcc or gcc+ may be needed, but they are GPL/open source and available in depot format.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dattesh Lotlikar
Occasional Advisor

Re: Unresolved Symbol:cout__3std (data) while loading shared library

Steven,
Thanks for your quick response.

The first point you have made of setting SHLIB_PATH and PATH has already been done, however it did not solve the issue.

Here is the output of SHLIB_PATH and PATH variables:

PATH:
/usr/local/directory/server:/oracle/OraHome1/bin:/opt/aCC/bin:/usr/bin:/usr/lib:/usr/local/bin:/usr/ccs/bin:/usr/local/tmake/bin:/opt/java1.3/bin:/usr/ccs/bin:/usr/bin:/opt/ansic/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/mx/bin:/opt/resmon/bin:/opt/scr/bin:/opt/ignite/bin:/opt/perl/bin:/opt/graphics/common/bin:/usr/sbin/diag/contrib:/opt/perf/bin:/usr/sbin:/opt/langtools/bin:/opt/aCC/bin:/opt/imake/bin:/opt/gnome/bin:/opt/prospect/bin:/usr/local/directory/server:/usr/local/directory/LDAPPlugin:/usr/local/icu/lib

SHLIB_PATH:
/usr/local/directory/server:/usr/local/directory/LDAPPlugin:/usr/local/lib:/usr/lib:/usr/local/icu/lib

The Library libReader.sl is located in /usr/local/directory/LDAPPlugin directory. While the directory server binary(dirserver) alongwith all its dependent user-defined libraries are located in /usr/local/directory/server

Inorder to make sure that dirserver uses the libraries from SHLIB_PATH, I have enabled the shared dynamic path search using following command:
chatr +s enable /usr/local/directory/server/dirserver

Part O/P of the above command confirms this:
.....
new values:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled second
embedded path disabled first Not Defined
.....

Do let me known if you require the complete O/P of above command.

I have also ran the same command on other supporting shared libraries in /usr/local/directory/server and /usr/local/directory/LDAPPlugin directories, just to make sure they are not dependent on other libraries.

Coming to your second point, I ran file and odump commands on both dirserver and shared libraries found in LDAPPlugin. From the output it looks like dirserver source files were compiled using aC++ B3910B A.03.45 while libReader.sl was compiled using the current system compiler aC++ B3910B A.03.39.

$odump -c dirserver
Compilation Unit Dictionary from pmserver:

Index Chunk Language Name
Product_id ; Version_id
Compile time ; Source time

0 0 PA-RISC 2.0 Assembler crt0.o

HP92453-03; UX.11.01.16
Compile Time: Fri Apr 05 2002 11:24:54.000000000 IST
Source Time: Fri Apr 05 2002 11:24:55.000000000 IST

1 0 HPC ../mapdld.c
/CLO/Components/LINKER/Src/csu/CRT_RELEASE
ccom options = -ESlit -DA1.1 -DS1.1 -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,P
g,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,ap,dn,Sg,pt,kt,Em,pc,np! +k -Ae

HP92453-01 ; B111104
Compile Time: Fri Apr 04 2003 10:41:41.000000000 IST
Source Time: Thu Jan 23 2003 15:47:33.000000000 IST

2 0 PA-RISC 2.0 Assembler

HP92453-03; UX.11.01.16
Compile Time: Wed Feb 05 2003 14:03:12.000000000 IST
Source Time: None

3 0 HPC ../maptsd.c
/CLO/Components/LINKER/Src/csu/CRT_RELEASE
ccom options = -ESlit -DA1.1 -DS1.1 -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,P
g,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,ap,dn,Sg,pt,kt,Em,pc,np! +k -Ae

HP92453-01 ; B111104
Compile Time: Fri Apr 04 2003 10:41:43.000000000 IST
Source Time: Thu Jan 23 2003 15:47:35.000000000 IST

4 0 PA-RISC 2.0 Assembler set_tp

HP92453-03; UX.11.01.16
Compile Time: Sat Mar 23 2002 12:12:32.000000000 IST
Source Time: Sat Oct 04 1997 08:32:46.000000000 IST

5 0 PA-RISC 2.0 Assembler cpprt0

HP92453-03; UX.11.01.14
Compile Time: Thu Jun 06 2002 02:47:49.000000000 IST
Source Time: Thu Jun 06 2002 02:47:49.000000000 IST

6 0 ANSI C++ assignmenttask.cpp
/export/home/build65/pm711n/server/lm
ctcom options = -diaga 400 -diags 392 -diags 302 -architecture portable -diag anachronisms,suggestions,warnings,futureerrors
-inst compiletime -diags 523 -inline_power 2 -longbranch 0 -unique_strings on -o assignmenttask.o -cachesize 256 -ansi_for_sc
ope on -plusooption -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,Pg,ug,Lu,lb,uj,dp,
Fs,bp,wp,cl,Ex,mp,rp,ap,dn,Sg,pt,kt,Em,pc,np!

B3910B ; A.03.45
Compile Time: Thu Aug 12 2004 07:42:34.000000000 IST
Source Time: Thu Feb 05 2004 09:33:39.000000000 IST
.....

$odump -c libReader.sl
Compilation Unit Dictionary from libReader.sl:

Index Chunk Language Name
Product_id ; Version_id
Compile time ; Source time

0 0 PA-RISC 2.0 Assembler cppshl0

HP92453-03; UX.11.01.14
Compile Time: Thu Jun 06 2002 02:47:46.000000000 IST
Source Time: Thu Jun 06 2002 02:47:47.000000000 IST

1 0 ANSI C++ shlInit.C
/CLO/Components/HPCXX/Src/SupportLib
ctcom options = -architecture 1.1 -scheduler 2.0 -piccode long -inst compiletime -diags 523 -inline_power 2 -longbranch 0 -un
ique_strings on -o obj/shlInit.o -cachesize 256 -plusooption -Oq02,al,ag,cn,lM,sz,IC,vo,lc,Mf,Po,es,rs,sp,in,vc,Pi,fa,pe,Rr,F
l,pv,pa,nf,cp,lx,st,ap,Pg,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,ap,dn,Sg,pt,kt,Em,pc,np!

B3910B ; X.03.30.
Compile Time: Thu Jun 06 2002 02:47:47.000000000 IST
Source Time: Fri Jul 12 1996 05:19:09.000000000 IST

2 0 ANSI C++ DSQ.cpp
/home/Informatica/LDAPPlugin/LDAPReader
ctcom options = -architecture portable -diag off -piccode long -inst compiletime -diags 523 -test namespaces -koenig_lookup o
n -ansi_for_scope on -inline_power 2 -longbranch 0 -unique_strings on -o DSQ.o -cachesize 256 -debug debugG1 -plusooption -Oq
02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,Pg,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,ap,dn
,Sg,pt,kt,Em,pc,np! -driver_command="/opt/aCC/bin/aCC -v -mt -w +DA portable -A A +Z -D volatile= -l pthread -z -g +O 2 -D UN
IX -D HP_UX -D VDADER_RULES -D SNACCDLL_NONE -D SNACC_DEEP_COPY -mt -D _strcmpi=strcasecmp -D DO_TRACING -D PC71 -D NDEBUG -I
include -I /usr/local/include -I /usr/local/directory/include -I /usr/local/directory/LDAPPlugin/include -c "

B3910B ; A.03.39
Compile Time: Mon Sep 19 2005 10:33:42.000000000 IST
Source Time: Fri Jun 03 2005 04:28:06.000000000 IST
...........
...........

From the above output it looks like there is difference in compiler versions, can this be the reason for all unresolved symbols. Anyway i'm applying A.03.45 aC++ patch.

Can you make any other obeservations based on the above outputs.

About your third point, both the pieces of software were build on HP-UX.
Infact the second piece, the libReader.sl is getting ported to HP-UX from Solaris, i'm refering to the standard document found at HP site: http://h30097.www3.hp.com/docs/STKS/SOLARIS.HTM for achiving this.

Thanks & Regards,
Dattesh Lotlikar




cing2006
Occasional Advisor

Re: Unresolved Symbol:cout__3std (data) while loading shared library

the _shlinit has been removed from the newer libraries and when we try to compile 32 bit programs, we need to link to libstd.sl for the _shlinit call. the rest shall fall in place after this linking is done (HOPE they do so)

Regards,
Banu