gdb 编译问题 yyin 和 lexer_init

gdb compile issue yyin and lexer_init

我正在尝试在 Ubuntu 18.04 中编译 gdb 9.2,打印出以下错误。

make[2]: Entering directory '/home/ata/gdb-9.2/build/gdb'
  CXX    ada-exp.o
ada-exp.y: In function ‘int ada_parse(parser_state*)’:
ada-exp.y:736:15: error: ‘yyin’ was not declared in this scope
ada-exp.y:736:15: note: suggested alternative: ‘yylen’
ada-exp.y:736:3: error: ‘lexer_init’ was not declared in this scope
ada-exp.y:736:3: note: suggested alternative: ‘pex_init’
In file included from ada-exp.y:56:0:

gdb 10.1在此之前编译成功

我在网上搜索,但找不到原因或解决方案。

可能是什么问题?

Edit1: 我有 gcc version 7.5.0

我也遇到了这个问题,我是这样解决的:
ada-exp.y 包含文件 ada-lex.c,其中包含函数 lexer_init 的定义。
但是,如果您最初没有安装 flex,那么它可能会生成一个空的 ada-lex.c(来自 ada-lex.l)。即使您执行 make clean,它也不会清除生成的 ada-lex.c,即,它在下一个编译命令时也将保持为空。
因此,要修复此错误,您可以删除所有此类中间 .c 文件(在您的情况下,使用新的 .tar.gz 进行构建)并再次进行制作。