看到可用gdb调试程序来发现segmentation fault,于是一时心痒,想去看gdb的调试信息。毕竟linux下的调试我还是空白。

本人是在VM上装ubuntu 9.10,编写了一个神一样的程序hello.cpp,然后gcc了一下,发现有个错误gcc:error trying to exec 'cclplus':execvp:没有该文件或目录,后来发现原来是没有安装g++,然后sudo apt-get install g++,搞定。

      然后看下gdb有没有安装,居然已经安装了,输入g++ -g -o hello hello.cpp 编译后 在输入 gdb ./hello 好了输入调试信息了,如果只是运行,直接./hello就好了。

 

我的是CentOS所以命令是:yum install gcc-c++

 

 

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐