我试图在Ubuntu18.04中编译GDB9.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:
GDB10.1在此之前成功编译。
我在网上搜索,但找不出原因或解决办法。
可能会有什么问题?
Edit1:我有gcc version 7.5.0
发布于 2021-01-15 07:07:06
我也面临着这个问题,我就是这样解决的:
ada-exp.y
包含文件ada-lex.c
,其中包含函数lexer_init
的定义。
但是,如果最初没有安装flex,那么它可能会生成一个空的ada-lex.c
(来自ada-lex.l
)。即使您执行make clean
,它也不会清除生成的ada-lex.c
,也就是说,在下一个编译命令时它也将保持为空。
因此,要修复此错误,您可以删除所有这样的中间.c
文件(在您的例子中,使用新的.tar.gz
构建)并再次执行make。
https://stackoverflow.com/questions/64661573
复制相似问题