delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/08/23:01:14

From: Jerzy Witkowski <Jerzy DOT Witkowski AT ii DOT uni DOT wroc DOT pl>
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: <x67m9gjaqc.fsf@ii.uni.wroc.pl>
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

"Fatzi Michael" <e9226698 AT stud2 DOT tuwien DOT ac DOT at> 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     


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019