bash - 找不到命令

时间:2014-02-11 11:37:01

标签: linux bash makefile

我在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

它说make:-bash: make: command not found

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

4 个答案:

答案 0 :(得分:11)

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

sudo yum install build-essential

答案 1 :(得分:4)

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

# yum groupinstall "Development Tools"

(不要输入#;这意味着代表root shell提示符。)

答案 2 :(得分:1)

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

答案 3 :(得分:0)

sudo apt-get install build-essential在Ubuntu 16上对我有用

相关问题