[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: |
John Millaway |
Subject: |
Re: flex-2.5.23 & C++: symbols multiply defined |
Date: |
Mon, 18 Nov 2002 09:39:04 -0500 (EST) |
> 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