linux - 安装 flex 时找不到 flex 命令

标签 linux makefile redhat flex-lexer configure

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(不需要重新配置)。

关于linux - 安装 flex 时找不到 flex 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33131815/

相关文章:

linux - "service postgresql start"和 "pg_ctl start"有什么区别?

c++ - CMake "--target install"没有 "--build"命令行

linux - 如何以组织良好的形式查看文本文件中的数据

android - 使用 shell 命令列出所有目录,而不使用 find、busybox 命令

C Linux 管道读取乱序。丢失和重复的输出

linux - su 在脚本中将其重定向到 super 用户目录

makefile - CUDA 8.0 nvcc致命: single input file required for a non-link phase when an ouputtfile is specified

c++ - 如何(字面意思)创建一个 makefile(用于 linux 中的 c)?

linux - 使用 preupg 时如何强制是

php - Symfony 链接到错误的 PHP 版本