首页 > 其他 > 详细

lex error

时间:2014-03-20 21:28:29      阅读:496      评论:0      收藏:0      [点我收藏+]

使用lex 是有好几次的接触, 最近看bpf的代码里面用到了lex, 于是代码也看不懂了

 

1.l:

%%
.|\n    ECHO;
%%

 

$ lex 1.l

km@kwingmei:~/programming/c/lex$ gcc lex.yy.c
/tmp/ccehk4zT.o: In function `yylex‘:
lex.yy.c:(.text+0x38b): undefined reference to `yywrap‘
/tmp/ccehk4zT.o: In function `input‘:
lex.yy.c:(.text+0xcd6): undefined reference to `yywrap‘
collect2: error: ld returned 1 exit status

 

错误原因是

The scanner calls this function on end of file, so you can point it to another file and continue scanning its contents.

If you don‘t need this, use

%option noyywrap

or link with -lfl to use the default yywrap() function in the library fl.

lex error,布布扣,bubuko.com

lex error

原文:http://www.cnblogs.com/kwingmei/p/3612661.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!