这是我的CPP计划
#include <iostream>
int main(int argc, char *argv[]){
return 0;
}
Run Code Online (Sandbox Code Playgroud)
编译并执行此操作会导致seg错误:
[18:08 ~] > g++ test.cpp
[18:09 ~] > ./a.out
Segmentation fault
Run Code Online (Sandbox Code Playgroud)
有没有人对这个问题有所了解吗?非常感谢你的帮助.
以下是一些可能有用的细节:
[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)
Run Code Online (Sandbox Code Playgroud)
还有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 …Run Code Online (Sandbox Code Playgroud)