From: Jerzy Witkowski Newsgroups: comp.os.msdos.djgpp Subject: Re: Error in compiling Date: 08 Dec 1997 13:11:23 +0100 Organization: University of Wroclaw Lines: 30 Sender: jwi AT swiatowit Message-ID: References: <01bd033d$4acfe970$ca238380 AT phobos> NNTP-Posting-Host: swiatowit.ii.uni.wroc.pl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "Fatzi Michael" writes: > When I use a FLEX-generated *.c file (with DJGPP V2) > gcc -lfl lexyy.c > > i get an interesting error and not an executable DOS-file: > > lexyy.c(.text+0x793): undefined reference to `yywrap' > lexyy.c(.text+0xf31): undefined reference to `yywrap' From the file flex.inf: 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. Hope this helps, Jerzy Witkowski