Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

While running a makefile in gcc 4.1.2 (linux 5), I got the following error

make: yacc: Command not found 

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.

How can this error be solved?

like image 551
Blackforest Avatar asked May 24 '12 07:05

Blackforest


2 Answers

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

Also you need byacc for a full functional yacc

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

It worked for me.

like image 158
Julius TM Avatar answered Sep 19 '22 13:09

Julius TM


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.

Since bison is supposed to be compatible with yacc so the first thing I would try would be:

alias yacc="bison" 

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

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

You can try to locate the yacc or bison executables with the command (substituting bison for yacc if need be):

which yacc 

But they're probably in one of the standard places like /bin or /usr/bin.

like image 44
paxdiablo Avatar answered Sep 20 '22 13:09

paxdiablo