yum install gcc bochs使用c++编写,编译源代码时用到gcc
yum groupinstall "Development Tools" yum install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel tcl-devel tk-devel kernel-headers kernel-devel不然在configure和make时会遇到错误(可以参考http://www.cnblogs.com/dczsf/archive/2011/03/08/1977019.html)
由于centos是面向服务器类型的,所以在使用yum安装某些个图形桌面软件时,显示的是没有,这时可以加入非官方的软件库,比如rpmforge:
下载与安装相应rpmforge的rpm文件包
1,下载rpmforge的rpm文件包
[root@CentOS ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
2,安装DAG的PGP Key
[root@CentOS ~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
3,验证rpmforge的rpm文件包
[root@CentOS ~]# rpm -K /home/Downloads/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
4,安装rpmforge的rpm文件包
[root@CentOS ~]# rpm -i /homeDownloads/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
5,设置/etc/yum.repos.d/rpmforge.repo文件中源的级别,就是添加priority=12这句。
如我的rpmforge.repo文件内容:
### Name: RPMforge RPM Repository for Red Hat Enterprise 5 – dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever – RPMforge.net – dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=12
当make是出现如下错误时:
当启用bochs 的debugger时,配置./configure --enable-debugger后make就出现下面的错误:
gui/libgui.a(gtk_enh_dbg_osdep.o): In function `MakeGTKthreads()':
/home/bcos/Desktop/bochs-test/bochs-2.4.pre1/gui/gtk_enh_dbg_osdep.cc:2120: undefined reference to `pthread_create'
collect2: ld returned 1 exit status
make: *** [bochs] Error 1
解决方法1:修改"Makefile.in" 92 和 93行 为 "CC = @CC@ -pthread" and "CXX = @CXX@ -pthread"
解决方法2:在Makefile.in中183行
bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \
$(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@
@LINK@ @EXPORT_DYNAMIC@ $(BX_OBJS) $(SIMX86_OBJS) \
@IODEV_LIB_VAR@ @DEBUGGER_VAR@ cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \
@GDBSTUB_VAR@ @FPU_VAR@ \
@NONPLUGIN_GUI_LINK_OPTS@ \
$(MCH_LINK_FLAGS) \
$(SIMX86_LINK_FLAGS) \
$(READLINE_LIB) \
$(EXTRA_LINK_OPTS) \
$(LIBS)
在最后$(LIBS)后面加上 \ -lpthread如下:
bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \
.
.
.
$(LIBS)\
-lpthread
即可编译通过。