码迷,mamicode.com
首页 > 其他好文 > 详细

一、如何安装bochs

时间:2015-02-04 20:07:51      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

bochs即我们要使用到的虚拟机

由于bochs使用sudo apt-get install bochs安装时不带调试功能,所以我们在官网上下载源码,自行编译,加配置项。

wget http://nchc.dl.sourceforge.net/project/bochs/bochs/2.4.5/bochs-2.4.5.tar.gz 

下载成功后进行解压

sudo  tar zxvf bochs-2.4.5.tar.gz

.进入bochs-2.4.5目录,运行configure脚本,它会测试你的机器,C/C++编译器以及一些库,用来判断何种配置适合于你的机器。运行:

cd bochs-2.4.5
sudo ./configure --enable-debugger --enable-disasm

(上面--enable-debugger --enable-disasm 是可选项,这两个是开启调试和反汇编功能)

正确运行后,会产生一个Makefile文件,然后:

sudo make 
sudo make install

常见错误及处理方法:

错误A.

configure: error: C++ preprocessor "/lib/cpp" fails sanity check

因为Bochs是用C++写的,所以这里要安装GNU gcc/g++编译器。

解决办法:

sudo apt-get install build-essential
sudo apt-get install g++

错误B.

checking for default gui on this platform... x11
ERROR: X windows gui was selected, but X windows libraries were not found.

解决办法:

sudo apt-get install xorg-dev

错误C

.ERROR: pkg-config was not found, or unable to access the gtk+-2.0 package.

解决办法:

sudo apt-get install libgtk2.0-dev

错误D.

make的时候提示 /usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined 
reference to symbol   pthread_create@@GLIBC_2.1   // 
lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing 
from command line collect2: error: ld r
解决办法:
在makefile的libs中添加如下内容 :
-lz -lrt -lm -lpthread

错误E:

/usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined reference to symbol ‘pthread_create@@GLIBC_2.2.5‘ /

/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

解决办法:

在makefile的libs中添加如下内容 :
-lpthread

 

一、如何安装bochs

标签:

原文地址:http://www.cnblogs.com/ccode/p/4273092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!