Ubuntu下安装Bochs各种奇怪错误汇总

(1) 出现

1 “ERROR: X windows gui was selected, but X windows libraries were not found.

解决办法:

1 sudo apt-get install libx11-dev xserver-xorg-dev xorg-dev

如果还不能解决,请尝试重新安装为2.4.5版本,我在2.3.5版本下尝试了好久,最终换为2.4.5版本一下就成功了。

 

(2) 出现

1 “ERROR: pkg-config was not found, or unable to access the gtk+-2.0 package. Install pkg-config and the gtk+ development package, or disable the gui debugger, or the wxWidgets display library (whichever is being used).”

2 ERROR: pkg-config was not found, or unable to access the gtk+-2.0 package.Install pkg-config and the gtk+ development package,or disable the gui debugger, or the wxWidgets display library (whichever is being used)

解决办法:

1 sudo apt-get install libgtk2.0-dev

(3)

1 checking for C compiler default output file name… configure: error: C compiler cannot create executables

解决方法:

1 apt-get install libc6-dev

(4)

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

解决方法:

1 apt-get install build-essential

(5)

1 X windows gui was selected, but X windows libraries were not found.

解决方法:参照04年课程论坛上的解决方法,配置的时候加上–with-nogui


Bochs启动程序

1安装过程:

        

tar xzvf bochs-2.3.5.tar.gz

cd bochs-2.3.5

./configure --enable-debugger --enable--disasm 

make
出现问题:
symbols.cc: At global scope:
      symbols.cc:137: error: ISO C++ forbids declaration of ‘hash_map’ with no type

symbols.cc:137: error: expected ‘;’ before ‘<’ token

symbols.cc:145: error: expected constructor, destructor, or type conversion before ‘<’ token
      symbols.cc: In constructor ‘context_t::context_t(Bit32u)’:
      symbols.cc:152: error: ‘map’ was not declared in this scope
      symbols.cc: In static member function ‘static context_t* context_t::get_context(Bit32u)’:
      symbols.cc:173: error: ‘map’ was not declared in this scope 
      make[1]: *** [symbols.o] Error 1  
     make: *** [bx_debug/libdebug.a] Error 2
解决方法:    
在做make 之前, 需要在bx_debug/symbols.cc 的97『具体版本可能不一样』 行之后加上一些代码,加后如下所示:

using namespace std;

#ifdef __GNUC__  ( 新加的,注意前后都是两个下划线 )

using namespace __gnu_cxx; ( 新加的,注意前面是两个下划线 )

#endif  ( 新加的)

struct symbol_entry_t;


当启用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

即可编译通过。

 

注意:Makefile.in就是用于configure来生成Makefile的,所以修改这个文件后,

需要重新执行:./configure --enable-debugger 来生成Makefile,

如果是在configure后修改Makefile.in,然后执行make,这个时候的Makefile还是编译出错。


# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage:file=$BXSHARE/BIOS-bochs-latest
#注意上面这一行,2.3.5以后的后面不能加,address=0xf0000  否则会出现
#Message: ROM: System BIOS must end at 0xfffff 错误的  这个后面会解释
#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
                                                                               
# what disk images will be used
floppya: 1_44=a.img, status=inserted
#ata0-master: type=disk, mode=flat, path="30M.sample"
# hard disk
#ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
#ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
#ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
#ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9
boot: floppy
log: bochsout.txt
mouse: enabled=0
floppya: 1_44=a.img, status=inserted
keyboard_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map

你可能感兴趣的:(linux_software)