"make:yacc:找不到命令";在安装Bison之后 [英] "make: yacc: Command not found" after installing Bison

查看:845
本文介绍了"make:yacc:找不到命令";在安装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 "$@"

您可以尝试使用以下命令找到yaccbison可执行文件(如果需要,将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆