在windows下使用flex时,若在代码中使用了:
extern int yylineno; // 提供当前的行数信息。 (lexer不一定支持。)
出现报错:undefined reference to `yylineno’
解决方法:
在.l文件中(如lex.l)的第一部分(difinition part)写下:
%option nounput yylineno
即可
在windows下使用flex时,若在代码中使用了:
extern int yylineno; // 提供当前的行数信息。 (lexer不一定支持。)
出现报错:undefined reference to `yylineno’
解决方法:
在.l文件中(如lex.l)的第一部分(difinition part)写下:
%option nounput yylineno
即可