可以在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.