Problem Statement: ================== When a simple C++ program containg one "cout", is compoled with following command. It runs fine on system where gcc is installed but not on different HPUX system where no GCC component are present. libstdc++.sl.5 and libgcc_s.sl are also copied along with program so that "ldd program" resolves fine.
Compilation command: ==================== g++ -Wall -o mtest -lstdc++ test.cpp System options, gcc configuration options, and Version g++ -v: =============== Reading specs from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/specs Configured with: /scratch/zack/pkgbuild/3.3.1/hpux-11/gcc-3.3.3/configure -- enable-languages=c,c++ --enable-threads=posix --disable-nls --with-gnu-as -- without-gnu-ld --with-as=/usr/local/bin/as --prefix=/usr/local Thread model: posix gcc version 3.3.3 uname -a: ========= HP-UX hpsms02 B.11.11 U 9000/800 2298023925 unlimited-user license Compiler output: ================= No outpput. Programm compiled successfully. PROGRAM FILE: ============= #include<iostream> #include<string> using namespace std; int main() { string str("test"); cout << "test string " << str << endl; } CORE: ====== hpsms05$gdb mtest 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. ..Autoloading size threshold (in megabytes) of shared library symbols is 804. /home/ngujarat/.gdbinit:2: Error in sourced command file: No symbol table is loaded. Use the "file" command. Core was generated by `mtest'. 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 0x2ebc in main () at mtest.cpp:8 (gdb) Thanks. -- Summary: g++ 3.3.3 compiled program segmention fault when run on HPUX system not having gcc Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: critical Priority: P1 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nileshrg at hotmail dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20575