views:

123

answers:

2

what libraries 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.

+1  A: 

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 GNU versions, which are rather different in many ways. I think YY_BUFFER_STATE is specific to the GNU implementation.

DigitalRoss
+1  A: 

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 Gnu flex and not the lex that comes with solaris.

Chris Dodd