安装 flex 时找不到 flex 命令

flex command not found when installing flex

tar xvjf flex-2.5.39.tar.bz2      // Uncompress the archive

cd flex-2.5.39                    // 

./configure --prefix=$HOME/flex   // ./configure

       *No errors*                //  success with no error
make                              //  run make

One thounsand lines later...      // Error
.../flex-2.5.39/missing: line 52: flex: command not found
WARNING: `flex` is missing on your system. You should only need it if you modified a `.l` ...etc  

错误说我的系统中没有安装 flex !!,我错过了什么?我正在安装它。
谢谢

这很奇怪 -- 你不应该需要现有的 flex,除非你在构建它之前修改了 scan.l。

检查 scan.c 和 scan.l 上的时间戳,确保 scan.c 存在并且更新。如果没有,运行

tar xjfv flex-2.5.39.tar.bz2 flex-2.5.39/scan.c

在父目录中重新提取(只是)scan.c然后重新运行 make(应该不需要重新配置)。