cancel
Showing results for 
Search instead for 
Did you mean: 

using STL on HPUX

 
Highlighted
Occasional Contributor

using STL on HPUX

Hi there,
I am facing a problem regarding stl functions used by HPUX 11.11 g++ compiler 3.3.3.
consider following program. which is compiled as:g++ -o test -lstdc++ test.cpp
After execution on the other machine where it can resolve all the dependencies, it gives core on execution.
=========================================
#include
#include

using namespace std;

int main()
{
string str("test");

cout << "test string " << str << endl;
}
=========================================
ldd test
=>
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/lib/libstdc++.sl.5 => /usr/local/lib/libstdc++.sl.5
/usr/lib/libc.2 => /usr/lib/libc.2
/scratch/zack/pkgbuild/3.3.1/hpux-11/gcc-3.3.3-b/gcc/libgcc_s.sl => /usr/local/lib/libgcc_s.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libm.2 => /usr/lib/libm.2
===============================================
if i run the executable , core is dumped.. gdb output is as follows:
=======================================
gdb test core
HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `test'.
Program terminated with signal 11, Segmentation fault.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.


warning: Can't find file /opt/graphics/OpenGL/lib/libogltls.sl referenced in dld
_list.

/opt/graphics/OpenGL/lib/libogltls.sl: No such file or directory.
#0 0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from /usr/local/lib/libstdc++.sl.5
(gdb) bt
#0 0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from /usr/local/lib/libstdc++.sl.5
#1 0xc5c16bec in _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xec
() from /usr/local/lib/libstdc++.sl.5
#2 0x35d8 in main+0x160 ()
(gdb) q
=============================================

Could you please pinpoint the problem here.

Thanks
-Manish
2 REPLIES 2
Highlighted
Honored Contributor

Re: using STL on HPUX

I can not comment on the error about "privately mapped shared library" But for this error - "/opt/graphics/OpenGL/lib/libogltls.sl" Does that shared library exists?? If yes, have you set SHLIB_PATH and/or LD_LIBRARY_PATH variables??
There is no substitute to HARDWORK
Highlighted
Occasional Contributor

Re: using STL on HPUX

it was a issue of HP patch for ld.
Thanks for your time and help.
Manish