lex on solaris??? (urgent, pls!!!)

Hi everyone,

I would like to know how to compile and run lex programs on solaris 10.

the conventional way is
$ lex <name.l>
$ cc lex.yy.c -ll
$ ./a.out

but while trying to execute the 2nd command :i get a reference saying that the command is old or that main is not supported...
Hence i would like to know how to run programs using lex???

These are the correct steps.

$ cat a.l
%%
a {printf("ouch");}
$ lex a.l
$ gcc lex.yy.c -ll
$ echo a b | a.out
ouch b

You should post the actual error message.