bash: make: 命令未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14671021/
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-09-18 04:26:06  来源:igfitidea点击:

bash: make: command not found

macosbashmakefile

提问by Wex

I am in a directory with a Makefile, but can't use I cannot use make

我在一个带有 Makefile 的目录中,但不能使用我不能使用 make

bash-3.2$ make
bash: make: command not found

How do I fix this?

我该如何解决?

回答by Wex

Make, among other things, is available through Apple's Command Line Tools. Install Command Line Tools through XCode by going to XCode->Preferences->Downloads

Make,除其他外,可通过 Apple 的命令行工具获得。通过转至 XCode 安装命令行工具XCode->Preferences->Downloads

You can also download Command Line Tools without installing XCode from the Apple Developer site: https://developer.apple.com/opensource/

您还可以从 Apple 开发者站点下载命令行工具而无需安装 XCode:https: //developer.apple.com/opensource/

回答by PeppyHeppy

If you have XCode installed then @Wex's answer will get you going quickly, otherwise you don't have to install Xcode to get the command-line tools you seek.

如果您安装了 XCode,那么@Wex 的答案将使您快速上手,否则您无需安装 Xcode 即可获得所需的命令行工具。

Check this out: https://github.com/kennethreitz/osx-gcc-installer

看看这个:https: //github.com/kennethreitz/osx-gcc-installer

You will want to install this one on Lion: https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg

你会想在 Lion 上安装这个:https: //github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg

Good luck!

祝你好运!

回答by Andor

I had the same problem. I was about to download and install command line tools until I saw in the download window that you can just use:

我有同样的问题。我正要下载并安装命令行工具,直到我在下载窗口中看到您可以使用:

xcrun make