lex

How to run / compile a lex program on commandline in Windows


I've seen a similar question here. That one works fine with Linux but don't work for windows.


Solution

  • For windows, use these commands:

    lex file.l
    
    gcc lex.yy.c
    
    a.exe 
    

    But make sure your PC has lex installed. You can learn more about the installation here if needed.