安装gbd
先看有没有 gdb
(字母打错了… gdb)
在网址:链接: http://ftp.gnu.org/gnu/gdb.下载gdb源码包(必然选第二新的版本)
使用xftp传输到lunix的root目录下面
解压
tar xzvf gdb-9.2.tar.gz -C /usr/src
解压成功
cd /usr//src/gdb-9.2
./configure
make && make install
注意:如果在执行./configure
出现
类似这样的错误
configure: error: you must configure in a separate build directory
那么从解压成功后执行下面步骤
//gcc 升级完所放的目录 路径下 新建gdb文件
mkdir /work/tool/gdb
cd /work/tool/gdb
/usr/src/gdb-9.2/configure
make && make install
.查看安装是否成功:gdb -v
一些知识点
./configure --prefix=/软件要安装的路径
“configure”脚本有大量的命令行选项,对不同的软件包来说,这些选项可能不同,也可以直接使用./configure而不指定路径,默认路径都是/usr/local/,
配置(configure)
编译(make)
安装(make install)
A compiler with support for C++11 language features is required.问题解决汇总
make时
可能会发生以下错误
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for gcc option to accept ANSI C... none needed
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... no
checking whether g++ supports C++11 features with -std=gnu++0x... no
checking whether g++ supports C++11 features with -std=c++11... no
checking whether g++ supports C++11 features with +std=c++11... no
checking whether g++ supports C++11 features with -h std=c++11... no
checking whether g++ supports C++11 features with -std=c++0x... no
checking whether g++ supports C++11 features with +std=c++0x... no
checking whether g++ supports C++11 features with -h std=c++0x... no
configure: error: *** A compiler with support for C++11 language features is required.
make[1]: *** [configure-gdb] 错误 1
make[1]: 离开目录“/usr/local/gdb”
make: *** [all] 错误 2
首先可能是缺少C++编译器,
yum install gcc gcc-c++
即可
如果还是不可以
就是由于gcc版本低,需要删除原来的gcc (版本低) 安装新的
下载新的gcc
链接: https://editor.csdn.net/md/?articleId=116036362.
`完事之后继续
make
make install
检验是否安装成功
which gdb
gdb -v
不知道是否需要配置环境变量 暂时 先这样 。。结束