转)Ubuntu16.04下安装DDD(Data Display Debugger)

时间:2021-02-02 02:06:12
以下转自:http://www.linuxdiyf.com/linux/26393.html
 
前两天在Linux论坛偶然间看到了DDD这个软件,根据介绍是一个gdb界面化的调试软件,这正是我找了好长时间的东西,有一个有界面的调试工具了,于是乎今天抽了个时间整了整,里面碰到了不少问题,下面一一说明一下。我使用的Ubuntu16.04,如果你使用的是CentOS可以参考:http://www.linuxdiyf.com/linux/21939.html,本人也是参考这篇文章安装的。
好了,废话不多说,上干货。
 
第一步,下载安装包并解压
我们可以从http://ftp.gnu.org/gnu/ddd/下载我们需要的版本,我下载的是最新版本ddd-3.3.12.tar.gz
#
wget http://ftp.gnu.org/gnu/ddd/ddd-3.3.12.tar.gz
# tar zxvf ddd-3.3.12.tar.gz
# cd ddd-3.3.12/
注意:解压时我们可以解压到任何地方。
 
第二步,配置
# ./configure --prefix=/usr/local/ddd
执行完这个后我们一般会遇到两个问题:
第一个错误提示
checking for tgetent in -lncurses... no  
checking for tgetent in -lcurses... no  
checking for tgetent in -ltermcap... no  
checking for tgetent in -ltinfo... no  
checking for termcap functions library... configure: error: No curses/termcap library found  
出现这个问题的原因是缺少ncurses安装包,我们安装就OK。
sudo apt-get install libncurses5-dev
第一个问题解决后,我们重新执行./configure --prefix=/usr/local/ddd,发现还有第二个问题,错误提示如下:
configure: error: The X11 library '-lX11' could not be found.  
Please use the configure options '--x-includes=DIR'  
and '--x-libraries=DIR' to specify the X location.  
See the files 'config.log' and 'ddd/config.log'  
for further diagnostics.  
原因是缺少openmotif,继续安装
sudo apt-get install libmotif-dev  
以上两个问题解决后再次执行./configure --prefix=/usr/local/ddd,如下没有错误提示OK!
转)Ubuntu16.04下安装DDD(Data Display Debugger)
第三步,编译
# make
如果出现下面的错误提示
转)Ubuntu16.04下安装DDD(Data Display Debugger)
错误的内容是EOF没有声明,我们需要修改相应的文件。在ddd-3.3.3.12/ddd中找到strclass.C文件,使用vim打开后加上#define EOF -1,保存退出,重新make,OK!
 
第四步:安装
#sudo make install
注意这里一定要用sudo,否则会报错。
 
第五步,启动。
#cd /usr/local/ddd/bin
#./ddd
 转)Ubuntu16.04下安装DDD(Data Display Debugger)
启动成功了。