here is my CPP program
#include <iostream> int main(int argc, char *argv[]){ return 0; }
compiling and executing this causes a seg error:
[18:08 ~] > g++ test.cpp [18:09 ~] > ./a.out Segmentation fault
Does anyone have any ideas on this issue? Many thanks for your help.
Here are some details that may be helpful:
[18:13 ~] > ldd a.out linux-vdso.so.1 => (0x00007fff3fdff000) libstdc++.so.6 => /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libstdc++.so.6 (0x00007fc8f4a53000) libm.so.6 => /lib64/libm.so.6 (0x00007fc8f47ce000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc8f45b8000) libc.so.6 => /lib64/libc.so.6 (0x00007fc8f4225000) /lib64/ld-linux-x86-64.so.2 (0x00007fc8f4ca5000)
as well as gdb:
[18:15 ~] > gdb ./a.out GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from ...done. (gdb) run Starting program: a.out Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7bd48ec in std::ios_base::Init::Init() () from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libstdc++.so.6 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.x86_64 libgcc-4.4.7-3.el6.x86_64 (gdb) bt
g ++
[10:14 ~] > g++ -v Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=x86_64-redhat-linux Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-19.el6)
and the last thing
[10:25 ~] > ls /usr/lib/gcc/x86_64-redhat-linux 3.4.6
Thanks.
source share