[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flex-2.5.23 & C++: symbols multiply defined
From: |
Jason Elbaum |
Subject: |
Re: flex-2.5.23 & C++: symbols multiply defined |
Date: |
Wed, 20 Nov 2002 10:54:16 +0200 |
Thanks.
Does this also fix the problem with yylex_destroy()?
In any case, this appears to be a workaround. It still seems to me that
the problem itself constitutes a bug. The prefix option is supposed to
prevent name clashes, right?
Jason Elbaum
John Millaway wrote:
>
> > I've just installed flex-2.5.23 for use generating C++ scanners with
> > g++-3.2, and I've come across the following problem.
> >
> > I have two flex++ scanners linked into a single executable. They use
> > different code prefixes: %option prefix="X" and %option prefix="Y".
> > However, it seems the prefix doesn't affect the definitions of
> > yyrealloc(), yyfree(), yyalloc() or yylex_destroy(). These functions are
> > defined in the C++ files of both scanners. The result, predictably, is
> > linker errors: ld: fatal: symbol `yyrealloc(void*, unsigned)' is
> > multiply-defined (etc.).
> >
> > Is there a way to correct this problem, either by applying the code
> > prefix to these functions or by moving them into the *FlexLexer class
> > generated?
> >
>
> Er, I just peeked at the manual entry. This is the correct way to do
> it:
>
> %option noyyalloc
> %option noyyrealloc
> %option noyyfree