在Windows上编译并运行flex程序(Compile and run flex programs on windows)
我编写简单的flex程序并使用以下代码在linux中运行它
flex filename.l cc lex.yy.c -lfl ./a.out
但是现在我想在windows中运行它我现在在下面的链接中执行命令我正在尝试编译flex文件,但是它表示cc不被识别然后我尝试使用以下命令编译它
gcc lex.yy.c -lfl
它说
cannot find -lfl
,然后我试试这个gcc lex.yy.c
但我得到了很多错误,例如
undefined reference to yywrap
。 我该怎么做来识别flex库?I write simple flex program and run it in linux with following code
flex filename.l cc lex.yy.c -lfl ./a.out
but now I want to run it in windows I do orders in following link now I am trying to compile flex file with following commend but it says that cc is not recognized then I try to compile it with following commend
gcc lex.yy.c -lfl
and it says that
cannot find -lfl
, then I try thisgcc lex.yy.c
but i got a lot of error for example
undefined reference to yywrap
. what should I do to recognize flex libraries ?
原文: