Gcc 使用flex时找不到-lfl

Gcc 使用flex时找不到-lfl,gcc,flex-lexer,lex,Gcc,Flex Lexer,Lex,这是我的示例flex文件 %{ /* need this for the call to getlogin() below */ #include <unistd.h> %} %% username printf("%s\n", getlogin()); %% main() { yylex(); } 我现在可以看到lex.yy.c文件了 我运行了以下gcc命令 $ gcc lex.yy.c -lfl 并得到以下错误: /usr/bin/ld: cannot

这是我的示例flex文件

%{
/* need this for the call to getlogin() below */
#include <unistd.h>
%}

%%
username        printf("%s\n", getlogin());
%%

main()
{
  yylex();
}
我现在可以看到lex.yy.c文件了

我运行了以下gcc命令

$ gcc lex.yy.c -lfl
并得到以下错误:

/usr/bin/ld: cannot find -lfl
collect2: ld returned 1 exit status

我的电脑中已经安装了flex。

在我的fedora盒子中安装flex static。i686软件包解决了这个问题。

在我的fedora盒子中安装flex static。i686软件包解决了这个问题。

现在需要的软件包似乎是flex-devel(我也在使用fedora).现在需要的软件包似乎是flex-devel(我也在使用Fedora)。
/usr/bin/ld: cannot find -lfl
collect2: ld returned 1 exit status