(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) 出现
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启动程序
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还是编译出错。