"make: yacc: command not found" after installing Bison

When running make file in gcc 4.1.2 (linux 5) I got the following error

make: yacc: Command not found 

From googling, I found out that this error can be fixed by installing the Bison-GNU parser generator. But even after installing Bison, I get the same error.

How can this error be resolved?

+6
source share
3 answers

From the looks of things, your makefile expects the yacc executable to be available, and also not, or it is not in your path.

Since bison supposed to be compatible with yacc , the first thing I will try is:

 alias yacc="bison" 

and try again. In my setup, /usr/bin/yacc is just a script containing:

 #! /bin/sh exec '/usr/bin/bison' -y " $@ " 

You can try to find yacc or bison executables using the command (replace bison with yacc if necessary):

 which yacc 

But they are probably in one of the standard places, such as /bin or /usr/bin .

+8
source

Run the following command on your terminal to install the bison, yacc executables and configurations. yacc comes with bison

Also you need byacc for full functional yacc

 sudo apt-get install bison -y sudo apt-get install byacc -y 

It worked for me.

+9
source

I ran into a similar problem on RHEL7.

Find where the bison is:

 $:which bison */bin/bison* 

Create a symlink for bison from yacc:

 sudo ln -s /bin/bison /bin/yacc 

And that should solve the problem.

0
source

Source: https://habr.com/ru/post/916532/


All Articles