Operating System - Linux
1753448 Members
6266 Online
108794 Solutions
New Discussion юеВ

Re: Run time can't find libstdc++.so

 
SOLVED
Go to solution
John Dorak
Advisor

Run time can't find libstdc++.so

Our application runs HP-UX on Itanium. One of the libs I work on links with libstdc++.so and during run time we get the error: Unable to find library libstdc++.so. Is this something we have to distribute with our application?
The build and test systems are both running: HP-UX B.11.23 U

Thanks,
JJD
12 REPLIES 12
TY 007
Honored Contributor

Re: Run time can't find libstdc++.so

Hello JJD,

Assume Application libstdc++.so.* location is:
/opt//lib/libstdc++.so.3

Issue command:
# cd /usr/lib/hpux32
# ln -s /opt//lib/libstdc++.so.3 libstdc++.so

Thanks
Dennis Handly
Acclaimed Contributor
Solution

Re: Run time can't find libstdc++.so

>Is this something we have to distribute with our application?

Exactly. This foreign devil lib doesn't come with the system.

>TY 007: # ln -s /opt//lib/libstdc++.so.3 libstdc++.so

While you could do this, it is probably better to include the path to /opt//lib in the executable. That way there is less things to change on the end user's system.
John Dorak
Advisor

Re: Run time can't find libstdc++.so

Thanks for the replies, we will be including this module in with our application libraries.

Another question, if I may.
Is there a way to flush out these run time link issues during build time?

Thanks,
JJD
John Dorak
Advisor

Re: Run time can't find libstdc++.so

This is a follow-up on my previous posting.

I am also getting some Unsatisfied data symbol errors during run time. Is there a way to flush these out during link time?

Thanks again,
JJD
Dennis Handly
Acclaimed Contributor

Re: Run time can't find libstdc++.so

>Is there a way to flush out these run time link issues during build time?

If you link with the -Wl,+b,path option to give the runtime path and you install there, you can at least make sure it runs. I'm not sure this is build time as you wanted?

>I am also getting some Unsatisfied data symbol errors during run time. Is there a way to flush these out during link time?

If you link with -Wl,-Bimmediate, you'll get these runtime unsats. Of course you'll need to install and run the application. And you then need to use "chatr -B deferred" to put put it back.

The linker does have the -Wl,+vshlibunsats option to print out shlib unsats.
John Dorak
Advisor

Re: Run time can't find libstdc++.so

Thanks again Dennis, this worked great. Now on to the next step, is there any documentation on what symbols are in what libs? Here's a sample of what I'm seeing:

ld: (Warning) Unsatisfied symbol "std::__rw_std_streams" in file CC_PropertySet.o
ld: (Warning) Unsatisfied symbol "_Unwind_SetIP" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_SetGR" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_GetIP" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_GetGR" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "std::basic_ostream >::_C_opfx()" in file CC_PropertySet.o
ld: (Warning) Unsatisfied symbol "__udivdi3" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "__divdi3" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_RaiseException" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_GetRegionStart" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "std::ios_base::_C_sync_with_stdio" in file CC_PropertySet.o
ld: (Warning) Unsatisfied symbol "std::ios_base::_C_unsafe_clear(int,int)" in file CC_PropertySet.o
ld: (Warning) Unsatisfied symbol "std::basic_istream >::_C_unsafe_get(long*,int,int)" in file /builds/Prebuilt/HPia64/icu/3.2/lib/libicuio.so
ld: (Warning) Unsatisfied symbol "_end" in file /usr/lib/hpux32/libc.so.1
ld: (Warning) Unsatisfied symbol "std::basic_istream >::_C_ipfx(int)" in file /builds/Prebuilt/HPia64/icu/3.2/lib/libicuio.so
ld: (Warning) Unsatisfied symbol "_Unwind_Resume" in file CC_Accessor.o
ld: (Warning) Unsatisfied symbol "main" in file /usr/lib/hpux32/libc.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_GetLanguageSpecificData" in file /usr/local/lib/hpux64/libstdc++.so
ld: (Warning) Unsatisfied symbol "_Unwind_DeleteException" in file /usr/local/lib/hpux64/libstdc++.so
19 warnings.
Completion of ./cc_common_build.sh build script


John Dorak
Advisor

Re: Run time can't find libstdc++.so

At run time it is not as bad (probably the library path is a bit more complete) but I still get the following and can't trace down the home library for them.

symbol not found: _ZSt16__rw_std_streams (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZNSt8ios_base18_C_sync_with_stdioE (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZTVSt14__rw_exception (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZNSs9__nullrefE (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZTVN4__rw17__rw_thread_errorE (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZTIN4__rw17__rw_thread_errorE (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZNSt6locale9_C_globalE (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)
symbol not found: _ZSt16__rw_std_streams (/u1/IBM/InformationServer/Server/DSComponents/lib/libicuio.so.32)
symbol not found: _ZNSt8ios_base18_C_sync_with_stdioE (/u1/IBM/InformationServer/Server/DSComponents/lib/libicuio.so.32)
bash-2.03$
Dennis Handly
Acclaimed Contributor

Re: Run time can't find libstdc++.so

You are appropriately hosed. You are mixing g++ and aC++.

>is there any documentation on what symbols are in what libs?

Why look up documentation when you can scan the libs:
$ nm -pxAN /usr/lib/hpux64/lib* /usr/local/lib/hpux64/lib* | grep -e foo1 -e foo2
(Or use grep -f and put the symbols in a file.)

Were you creating an executable or shlib (with -b)?

ld: (Warning) Unsatisfied symbol "_Unwind_SetIP" in file /usr/local/lib/hpux64/libstdc++.so

This is why I don't use -Wl,+vshlibunsats. This is defined in libunwind. And it shouldn't have been listed. (I assume g++ is smart enough to include -lunwind.)

ld: (Warning) Unsatisfied symbol "__udivdi3" in file /usr/local/lib/hpux64/libstdc++.so

This lib is broken. It was linked incorrectly and should have its own copy of these functions.

ld: (Warning) Unsatisfied symbol "_end" in file libc.so.1
ld: (Warning) Unsatisfied symbol "main"

These are found in your executable.

>At run time it is not as bad (probably the library path is a bit more complete)

No, because +vshlibunsats gives too much info. There is a better tool for PA32, show_remaining_imports:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1115429
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1151071
But you need show_remaining_imports_elf which I haven't attached yet.

>but I still get the following and can't trace down the home library for them.
symbol not found: _ZSt16__rw_std_streams (/u1/IBM/InformationServer/ASBNode/lib/cpp/libfcl.so)

It should be obvious. ;-) They come from aC++, not your foreign devil g++. The nm(1) fragment above would have told you that.

You must not use libfcl.so and libicuio.so.32 in your g++ application, or you must port everything to aC++. I doubt IBM would port those libs to g++ or C for you.

John Dorak
Advisor

Re: Run time can't find libstdc++.so

Thanks Dennis,
The libfcl.so is the component I'm porting to HP Itanium. This shared lib is ported across a number of OS platforms but this is the first time for this module on HPUX Itanium.

I'm not surprised some g++ got in there, some of the libs we use are from open source projects.

I'll give some of your suggestions a try.

Regards,
JJD
dorak@us.ibm.com