how to solve this undefined reference to 'yylval' in the the most simple program ever ?
This is my lexer.l file
%{ #include "parser.tab.h"%}%%[0-9]+ { yylval = atoi(yytext); return NUMBER; }"-" {return MINUS;}%%int main (){ yylex(); return 0;}and this is my parser file
%{#include <stdio.h>#include <stdlib.h>void yyerror(const char* msg); int n=0;%}%token MINUS %token NUMBER%%program : NUMBER MINUS NUMBER { n=$1-$3 ; printf("%d\n",n);}%%void yyerror(const char* msg){ printf("%s\n", msg); }int main() { printf("Enter "); yyparse(); // Start parsing return 0;}and this are my cmd commands to run this program
C:\Users\User\Desktop\workbench\prevodiocip\nnn>bison -d parser.yC:\Users\User\Desktop\workbench\prevodiocip\nnn>flex lexer.lC:\Users\User\Desktop\workbench\prevodiocip\nnn>gcc -o parser.tab.c lex.yy.c -lflC:\Users\User\AppData\Local\Temp\ccOvWXJo.o:lex.yy.c:(.text+0x1b1): undefined reference to `yylval'collect2.exe: error: ld returned 1 exit statusI have tried everything but nothing works for me