Running lex program

Asked by Rohan

I have written code for lex named nlp.l. Then i compiled it using command
$ lex nlp.l
its compiling it properly.
Then i linked the program using command
$ cc lex.yy.c -o first -ll
its also linking it properly.
Now i want to run it. I tried command
$ ./a.out
but it says
bash: ./a.out: No such file or directory
Help!! Packages like flex and gcc are installed properly.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu flex Edit question
Assignee:
No assignee Edit question
Solved by:
David Hoeffer
Solved:
Last query:
Last reply:
Revision history for this message
Best David Hoeffer (d-hoeffer) said :
#1

a.out is the default name of the program produced by the compiler. You used the parameter "-o first", and therefore your program will be called "first". Try running it with
$./first

Revision history for this message
Rohan (ronbenkar) said :
#2

Thanks David Hoeffer, that solved my question.

Revision history for this message
Rohan (ronbenkar) said :
#3

Hey thanks David. Thanks a lot. It worked. Such a silly mistake.