westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.55k stars 529 forks source link

Broken yywrap()? #593

Open rdratlos opened 11 months ago

rdratlos commented 11 months ago

When using flex to develop packages, which rely on yywrap(), static library libl.a (linked to libfl.a) is required. Linking to yywrap() provided by shared library libfl.so is not possible.

Steps to reproduce:

Result:

checking for lex library... none needed
checking for library containing yywrap... no
checking for lex library... none needed
checking for library containing yywrap... -ll

config.log contains following error if the static library is not available:

/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status

Is this a bug or a feature? Both, static and shared library provide function yywrap() but it seems to be broken in the shared lib.

Affected version: 2.6.4