Thursday, 15 April 2010

c - Compile and run flex programs on windows -



c - Compile and run flex programs on windows -

i write simple flex programme , run in linux next code

flex filename.l cc lex.yy.c -lfl ./a.out

but want run in windows orders in next link trying compile flex file next commend says cc not recognized seek compile next commend

gcc lex.yy.c -lfl

and says cannot find -lfl, seek this

gcc lex.yy.c

but got lot of error illustration undefined reference yywrap. should recognize flex libraries ?

the issue cant find library. on linux under /usr/bin or usr/local/bin both on scheme path. on windows there no such standard place libraries.

when utilize -lfl alternative search on scheme path file called libfl.o (shared library) or libfl.a (static library) , link binary file.

so need provide location of library using -l alternative gcc.

your new compile command hence be.

gcc lex.yy.c -l<path library> -lfl

c compiler-construction cmd

No comments:

Post a Comment