PA0的Getting Source Code for PAS部分,遇到编译问题:
如下:
/home/lee/Desktop/ysyx-workbench/nemu/scripts/config.mk:5: Warning: .config does not exists!
/home/lee/Desktop/ysyx-workbench/nemu/scripts/config.mk:6: To build the project, first run 'make menuconfig'.
+ YACC build/parser.tab.h
make[1]: bison: No such file or directory
make[1]: *** [Makefile:27: build/parser.tab.h] Error 127
make: *** [/home/lee/Desktop/ysyx-workbench/nemu/scripts/config.mk:24: /home/lee/Desktop/ysyx-workbench/nemu/tools/kconfig/build/mconf] Error 2
警告为.config文件不存在,在STFW之后才知道这个警告无须在意,在编译成功之后文件会自动生成。继续往下看:
make[1]: bison: No such file or directory
提示缺少bison文件(编译原理我XXX)
于是执行语句:
sudo apt-get install bison
再次执行
make menuconfig
又报错:
make[1]: flex: No such file or directory
于是又安装:
sudo apt-get install flex
安装完成,再次make menuconfig,终端内容如下:
/home/lee/Desktop/ysyx-workbench/nemu/scripts/config.mk:5: Warning: .config does not exists!
/home/lee/Desktop/ysyx-workbench/nemu/scripts/config.mk:6: To build the project, first run 'make menuconfig'.
+ LEX build/lexer.lex.c
+ CC build/lexer.lex.c
+ CC build/parser.tab.c
+ CC mconf.c
+ CC lxdialog/util.c
+ CC lxdialog/checklist.c
+ CC lxdialog/inputbox.c
+ CC lxdialog/yesno.c
+ CC lxdialog/textbox.c
+ CC lxdialog/menubox.c
+ LD /home/lee/Desktop/ysyx-workbench/nemu/tools/kconfig/build/mconf
+ CC confdata.c
+ CC expr.c
+ CC preprocess.c
+ CC symbol.c
+ CC util.c
+ CC build/lexer.lex.c
+ CC build/parser.tab.c
+ CC conf.c
+ LD /home/lee/Desktop/ysyx-workbench/nemu/tools/kconfig/build/conf
+ CC fixdep.c
+ LD /home/lee/Desktop/ysyx-workbench/nemu/tools/fixdep/build/fixdep
configuration written to .config
随后弹出:
根据终端反馈,在弹出上述页面之前,仍然存在一个warning。但在保存配置后,.comfig文件已经被创建。之后再次运行make menuconfig,可以发现直接弹出上述弹窗。
文章参考自:
南大计算机系统实验PA0 Compiling and Running NEMU报错解决方法_warning: .config does not exists!-CSDN博客