如何打印发生错误的行号。我尝试yylineno在yyerror()函数中使用并%option yylineno在.l文件中写入,但编译后它给我一个错误“ yylineno undeclared (first use in this function)”,如果我初始化yylineno为 1,它会给我这个错误:
error: redefinition of yylineno
lex.yy.c:273: note: previous definition of yylineno was here