Wrote the following code in flex and c file has generated but compiler shows "undefined reference to 'yywrap' " error.
%{
int nchar;
int nline;
%}
%%
[\n] {nline++;}
. {nchar++;}
%%
void main(void){
yylex();
printf("%d%d,nchar,nline");
}
Questions like this have been asked and all the answers were based on ignoring yywrap function like adding #define yywrap() 1 Which in this case the program runs but doesn't work but I want it to work.