【问题标题】:bash - make command not foundbash - 找不到make命令
【发布时间】:2014-02-11 11:37:00
【问题描述】:

我在我的 linux ec2 服务器中创建了名为 Makefile 的 make 文件。

all: a b

a: daemon.cpp dictionary_exclude.cpp
        g++ -o a daemon.cpp dictionary_exclude.cpp -lpthread -std=c++0x -L.

b: user_main.cpp client.cpp
        g++ -o b user_main.cpp client.cpp

我可以成功地独立运行每一个。

但是当我执行时

make
make -f Makefile

上面写着:-bash: make: command not found

有什么想法吗?我可以通过 man make 手动查看 make 是可用的

【问题讨论】:

  • man make 会给你一些关于make 命令的文档。您可以在不安装make 本身的情况下安装文档,因此man make 不是检查程序是否安装的好测试。

标签: linux bash makefile


【解决方案1】:

请执行以下命令在您的系统中安装make

sudo yum install build-essential

【讨论】:

  • build-essential 用于apt-get"Development Tools" 包相当于yum 下的包
【解决方案2】:

在 CentOS 或 Red Hat 中,试试这个:

yum groupinstall "Development Tools"

【讨论】:

    【解决方案3】:

    可能是您没有安装 binutils http://en.wikipedia.org/wiki/GNU_Binutils 或者您没有将 PATH 变量设置为 bin utils 的正确位置。

    【讨论】:

    • make 不是binutils 包的一部分。
    【解决方案4】:

    sudo apt-get install build-essential 在 Ubuntu 16 上为我工作

    【讨论】:

      猜你喜欢
      • 2011-06-17
      • 1970-01-01
      • 2013-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-02
      • 1970-01-01
      相关资源
      最近更新 更多