Linux bash - 找不到 make 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21700755/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:59:52  来源:igfitidea点击:

bash - make command not found

linuxbashmakefile

提问by user3245689

I have created make file named Makefilein my linux ec2 server.

我已经创建了Makefile在我的 linux ec2 服务器中命名的 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

I could run each of this independently successfull.

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

But when I execute

但是当我执行

make
make -f Makefile

It says make : -bash: make: command not found

它说: -bash: make: command not found

Any idea? I can see manually for make is available through man make

任何的想法?我可以手动看到 make 可以通过 man make 获得

采纳答案by Rahul R Dhobi

Please execute following command to install make in your system

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

sudo yum install build-essential

回答by Pradheep

It might be that you have not installed binutils http://en.wikipedia.org/wiki/GNU_Binutilsor you have not set your PATH variable to the correct location of bin utils.

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

回答by tonysok

In CentOS or Red Hat, try this:

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

yum groupinstall "Development Tools"

回答by techkuz

sudo apt-get install build-essentialon Ubuntu 16 worked for me

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