“make: yacc: Command not found” after installing Bison

前端 未结 4 2286
盖世英雄少女心
盖世英雄少女心 2021-02-19 01:50

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

相关标签:
4条回答
  • 2021-02-19 02:01

    I created the alias file on my Ubuntu 16 system, while testing then I found that bison was missing so I installed bison which gave me an error about the link that I had made for /usr/bin/yacc, so the bison install creates the lnk file itself for yacc on Ubuntu 16.

    0 讨论(0)
  • 2021-02-19 02:11

    I ran into a similar issue on RHEL7.

    Find where bison is:

    $:which bison
    
    */bin/bison*
    

    Create symlink to bison from yacc:

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

    And that should solve the problem.

    0 讨论(0)
  • 2021-02-19 02:19

    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.

    0 讨论(0)
  • 2021-02-19 02:26

    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.

    0 讨论(0)
提交回复
热议问题