开发者

running a lex program in linux mint

I am trying to run a lex program in linux mint.I saved that file as abc.l,now i am trying to compile this file in the termin开发者_开发百科al by typing the following commands:

vi abc.l

lex abc.l

gcc lex.yy.c -lfl

but after the last command it is saying that no such file or directory.

please help me out in running the program.


First of all check if you have installed Lex on your system by doing a "man lex" . If not installed,you need to install Lex & Yacc tools by typing these in the command prompt

$sudo apt-get install flex
$sudo apt-get install bison

For compiling try this command,

$ cc -w lex.yy.c -ll

Then to run the actual program,type

$./a.out
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜