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

要在Ubuntu安装Bochs 2.7,你需要安装一些依赖库。根据引用中的信息,你可以使用apt命令来安装这些依赖库。你需要安装的依赖库包括libgtk2.0-dev、libgtk-3-dev、libxpm-dev和libxrandr-dev。 在安装之前,你可能需要注意引用中提到的不同Linux版本可能有不同的包名。所以,如果你在使用apt命令时找不到对应的包名,建议你通过谷歌搜索来查找对应的包名。你可以搜索"ubuntu pacman包名",也许能找到Ubuntu下对应的包名。 在安装过程中,可能会遇到一些问题。例如,引用中提到的X11/Xlib.h文件找不到的错误。还可能出现"no acceptable C compiler found in $PATH"的错误。对于这些问题,你可以按照引用中给出的解决方案继续安装。 总结起来,要在Ubuntu安装Bochs 2.7,你需要先安装一些依赖库,然后使用apt命令安装这些依赖库。如果遇到问题,你可以通过谷歌搜索来寻找解决方案。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [在 ubuntu安装 bochs 2.7 的经历](https://blog.csdn.net/shimly123456/article/details/130696204)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Ubuntubochs详细安装步骤(超详细!)](https://blog.csdn.net/weixin_49635198/article/details/126831887)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值