what librarie开发者_如何学编程s should be linked in lex & yacc (solaris) to include YY_BUFFER_STATE. when i use YY_BUFFER_STATE in lex and compile it .i get an error saying tat it is undeclared.but when i do it in unix i am getting the output so pls help me.
There's no library required for YY_BUFFER_STATE -- its all built into the generated scanner by flex. However, it IS flex specific, so you have to use flex and not the lex that comes with solaris.
The lex library is historically libl
so it would be linked with -ll
. A classical link line might be -ll -ly
for lex and yacc.
Sometimes you need -lfl
to specify the flex
library.
Since you are on Solaris you may have the real lex/yacc and you may have the free versions, which are rather different in many ways. I think YY_BUFFER_STATE
is specific to the free implementation.
精彩评论