it seems your Lexer.l file is not compatible with the latest GNU flex tool.
may be older version will help or your Lexer.l file was previously processed by very different tool
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All,
I used the following steps to create a Console App and added the lexer.l for compiling and followed steps in this https://sourceforge.net/p/winflexbison/wiki/Visual%20Studio%20custom%20build%20rules/
when I get the following errors when compiling lexer.l
Severity Code Description Project File Line Suppression State
Error MSB3721 The command "
start /B /WAIT /D "C:\VSTS\ABI\Src\ExpCompile\ConsoleApplication1\" win_flex.exe --outfile="Lexer.flex.cpp" --wincompat --lex-compat --c++ "Lexer.l"
exit /b %errorlevel%" exited with code 1. ConsoleApplication1 C:\VSTS\ABI\win_flex_bison-latest\custom_build_rules\win_flex_bison_custom_build.targets 129
Error MSB3721 The command "
start /B /WAIT /D "C:\VSTS\ABI\Src\ExpCompile\ConsoleApplication1\" win_flex.exe --outfile="Lexer.flex.cpp" --wincompat --lex-compat --c++ "Lexer.l"
exit /b %errorlevel%" exited with code 1. ConsoleApplication1 C:\VSTS\ABI\win_flex_bison-latest\custom_build_rules\win_flex_bison_custom_build.targets 129
Error MSB3721 The command "
start /B /WAIT /D "C:\VSTS\ABI\Src\ExpCompile\ConsoleApplication1\" win_flex.exe --outfile="Lexer.flex.cpp" --wincompat --lex-compat --c++ "Lexer.l"
exit /b %errorlevel%" exited with code 1. ConsoleApplication1 C:\VSTS\ABI\win_flex_bison-latest\custom_build_rules\win_flex_bison_custom_build.targets 129
Any idea what could be the reason for these errors.
Thanks
GS
Hi GS,
The first thing I suggest to check is if path to win_flex.exe and win_bison.exe is added to PATH environment variable.
Regards,
Alex
Thanks the path wasnt there I added it but it still give the same error
Can you go to "C:\VSTS\ABI\Src\ExpCompile\ConsoleApplication1\" folder and run
win_flex.exe --outfile="Lexer.flex.cpp" --wincompat --lex-compat --c++ "Lexer.l"
there?
Do you have Lexer.l in this folder?
Does the command produce Lexer.flex.cpp file?
Hi Alex,
I tried executing it through the command prompt but I get the following error:
C:\VSTS\ABI\Src\ExpCompile\ConsoleApplication1>win_flex.exe --outfile="EXPLEXER.cpp" --wincompat --lex-compat --c++ "Lexer.l"
Lexer.l:1: bad character: %
Lexer.l:1: unknown error processing section 1
Lexer.l:1: unknown error processing section 1
Lexer.l:1: unknown error processing section 1
Lexer.l:2: bad character: /
Lexer.l:2: bad character: /
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:2: unknown error processing section 1
Lexer.l:3: bad character: /
Lexer.l:3: bad character: /
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:3: unknown error processing section 1
Lexer.l:4: bad character: /
Lexer.l:4: bad character: /
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:4: unknown error processing section 1
Lexer.l:5: unrecognized '%' directive
Lexer.l:45: unrecognized '%' directive
Lexer.l:47: bad character: {
Lexer.l:55: bad character: }
Lexer.l:55: bad character: ;
Lexer.l:58: bad character: %
Lexer.l:58: bad character: }
win_flex.exe: Can't use -+ with -l option
Thanks
GS
it seems your Lexer.l file is not compatible with the latest GNU flex tool.
may be older version will help or your Lexer.l file was previously processed by very different tool