Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does GNU flex library libfl provide?

I could compile a program from flex and bison generated files by

cc lex.yy.c program.tab.c -o output

and also by

cc lex.yy.c program.tab.c -lfl -o output

They both run smoothly and without any problem.

So what did libfl provide here? I tried to search the documentation but couldn't find a detailed explanation.

like image 859
xji Avatar asked Sep 18 '25 18:09

xji


1 Answers

$ nm /usr/lib/x86_64-linux-gnu/libfl.a
libmain.o:
0000000000000000 T main
                 U yylex
libyywrap.o:
0000000000000000 T yywrap

As you can see it provides functions main and yywrap, so you needn't define them.

like image 61
Nikolai Avatar answered Sep 20 '25 09:09

Nikolai