"make:yacc:找不到命令";在安装Bison之后 [英] "make: yacc: Command not found" after installing Bison
问题描述
在gcc 4.1.2(linux 5)中运行makefile时,出现以下错误
While running a makefile in gcc 4.1.2 (linux 5), I got the following error
make: yacc: Command not found
通过谷歌搜索,我知道可以通过安装Bison-GNU解析器生成器来纠正此错误. 但是即使安装了Bison,我仍然遇到相同的错误.
By googling, I came to know that this error can be rectified by installing Bison-GNU parser generator. But even after installing Bison, I get the same error.
该错误如何解决?
推荐答案
从外观上看,您的makefile期望yacc
可执行文件可用,或者它不存在,或者不在您的路径上.
From the looks of things, your makefile is expecting a yacc
executable to be available and either it's not, or it's not on your path.
由于bison
应该与yacc
兼容,所以我首先要尝试的是:
Since bison
is supposed to be compatible with yacc
so the first thing I would try would be:
alias yacc="bison"
,然后重试.在我的设置中,/usr/bin/yacc
只是一个包含以下内容的脚本:
and try again. On my setup, /usr/bin/yacc
is simply a script containing:
#! /bin/sh
exec '/usr/bin/bison' -y "$@"
您可以尝试使用以下命令找到yacc
或bison
可执行文件(如果需要,将bison替换为yacc):
You can try to locate the yacc
or bison
executables with the command (substituting bison for yacc if need be):
which yacc
但是它们可能位于/bin
或/usr/bin
等标准位置之一.
But they're probably in one of the standard places like /bin
or /usr/bin
.
这篇关于"make:yacc:找不到命令";在安装Bison之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!