可以在lex.c加入如下的行來解決問題。
#define yywrap()? 1

更好的辦法是定義:
int yywrap()
{?
???return(1);
}

關于yywrap更詳細的信息可以參考unix的lex manual
http://www.scit.wlv.ac.uk/cgi-bin/mansec?1+lex

int yywrap(void)
?????????? Called by yylex at? end-of-file;? the? default? yywrap
?????????? always? will? return? 1.? If? the application requires
?????????? yylex to continue processing with? another? source? of
?????????? input,? then? the? application? can include a function
?????????? yywrap, which associates another file with the? exter-
?????????? nal? variable? FILE? *yyin? and will return a value of
?????????? zero.

或flex的參考手冊(這個貌似更廣泛一點):
http://www.gnu.org/software/flex/manual/html_mono/flex.html

When the scanner receives an end-of-file indication from YY_INPUT, it then checks the `yywrap()' function. If `yywrap()' returns false (zero), then it is assumed that the function has gone ahead and set up yyin to point to another input file, and scanning continues. If it returns true (non-zero), then the scanner terminates, returning 0 to its caller. Note that in either case, the start condition remains unchanged; it does not revert to INITIAL.

If you do not supply your own version of `yywrap()', then you must either use `%option noyywrap' (in which case the scanner behaves as though `yywrap()' returned 1), or you must link with `-lfl' to obtain the default version of the routine, which always returns 1.