Unable to resolve compilation error in c file, provided with the lex/yacc book by John Levine.
by ajiten from LinuxQuestions.org on (#6J08F)
Am facing a never before seen error on compiling the first file in the code given for the sole book available for learning lex/yacc, i.e. the book by John Levine, Tony Mason, & Doug Brown; titled: Lex & Yacc, second edition.
The error is shown before, as given, at the top, in the page #7 (of the book).
Code: $ cc lex.yy.c -o first -ll
ch1-02.l:38:1: warning: return type defaults to int' [-Wimplicit-int]
38 | main()
| ^~~~
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -ll: No such file or
directory
collect2: error: ld returned 1 exit statusThe screenshot of the cygwin terminal is attached herewith too.
P.S. If you are feeling uncomfortable by a minor typo in page#7, though even I didn't; then the typo screen is attached herewith, and the errata page is here.
Attached Thumbnails
The error is shown before, as given, at the top, in the page #7 (of the book).
Code: $ cc lex.yy.c -o first -ll
ch1-02.l:38:1: warning: return type defaults to int' [-Wimplicit-int]
38 | main()
| ^~~~
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -ll: No such file or
directory
collect2: error: ld returned 1 exit statusThe screenshot of the cygwin terminal is attached herewith too.
P.S. If you are feeling uncomfortable by a minor typo in page#7, though even I didn't; then the typo screen is attached herewith, and the errata page is here.
Attached Thumbnails