I am having a problem with "Compile single file to object file" that I do not know how to resolve.
Code::Blocks version 16.01
Ubuntu version 16.04 LTS
Code::Blocks updates from:
http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntuFrom Code::Blocks menu item "Settings" > "Compiler..." > "Global compiler settings" > "Other settings" tab > "Advanced options..." button > "Commands" tab
"Source ext." l (el) is defined as follows:
Command line macro: flex -o$file_dir/$file_name.scanner.cc $file
Generated files (to be further compiled): $file_dir/$file_name.scanner.cc
"Source ext." y is defined as follows:
Command line macro: bison -v -d $file -o $file_dir/$file_name.parser.cc
Generated files (to be further compiled): $file_dir/$file_name.parser.cc
$file_dir/$file_name.parser.hh
I do not recall making any changes to these (default definitions after installing Code::Blocks).
I created a new Code::Blocks project and added a .l and .y file to the project. I open the .l file and select menu item "Build" > "Compile current file". This results in the following error in the Code::Blocks "Build log" tab:
Flex
/bin/sh: 1: Flex: not found
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Note that Flex has a capital F.
I open the .y file and select menu item "Build" > "Compile current file". This executes bison and shows me the errors in the .y file.
From Terminal:
$ flex Scanner.l
$ Flex Scanner.l
No command 'Flex' found, did you mean:
Command 'plex' from package 'fp-utils-3.0.0' (universe)
Command 'flex' from package 'flex-old' (universe)
Command 'flex' from package 'flex' (main)
Command 'lex' from package 'flex-old' (universe)
Command 'lex' from package 'flex' (main)
Command 'clex' from package 'clex' (universe)
Command 'jlex' from package 'jlex' (universe)
Command 'alex' from package 'alex' (universe)
Flex: command not found
$ bison Parser.y
"Parser.y", line 1: junk after `%%' in definition section
Segmentation fault (core dumped)
$ whereis flex
flex: /usr/bin/flex /usr/share/man/man1/flex.1.gz /usr/share/info/flex.info-2.gz /usr/share/info/flex.info-1.gz /usr/share/info/flex.info.gz
$ whereis bison
bison: /usr/bin/bison /usr/share/man/man1/bison.1.gz /usr/share/info/bison.info-5.gz /usr/share/info/bison.info.gz /usr/share/info/bison.info-2.gz /usr/share/info/bison.info-1.gz /usr/share/info/bison.info-3.gz /usr/share/info/bison.info-4.gz
$
When a .l file is open in Code::Blocks and I select menu item "Build" > "Compile current file", why is the command Flex (with capital F) being invoked?
John