macos 在 Mac 上安装“make”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11494522/
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
installing "make" on Mac
提问by Baseem Najjar
I'm trying to install Memcached on Mac using this tutorial: http://tugdualgrall.blogspot.de/2011/11/installing-memcached-on-mac-os-x-and.htmlbut when I try ./configure it says: configure: error: no acceptable C compiler found in $PATH when I try make it says: make sh: make: command not found sh-3.2# yum install make sh: yum: command not found sh-3.2# apt-get install make sh: apt-get: command not found
我正在尝试使用本教程在 Mac 上安装 Memcached:http: //tugdualgrall.blogspot.de/2011/11/installing-memcached-on-mac-os-x-and.html但是当我尝试 ./configure 时说:配置:错误:在 $PATH 中找不到可接受的 C 编译器,当我尝试 make 时说:make sh: make: command not found sh-3.2# yum install make sh: yum: command not found sh-3.2# apt-get安装make sh:apt-get:找不到命令
I must mention that I have Xcode but it's still not working. I'm really new on Mac so please take that into consideration :) I would really appreciate your help Thanks!
我必须提到我有 Xcode,但它仍然无法正常工作。我在 Mac 上真的很新,所以请考虑到这一点:) 我真的很感激你的帮助 谢谢!
回答by torrey.lyons
If you have Xcode 4.3 or newer the command line tools, such as make, are not installed by default. In Xcode preferences go to the "Downloads" tab and under "Components" push the "Install" button next to "Command Line Tools". After you have successfully downloaded and installed the command line tools you should also type the following command in the Terminal to make sure all your Xcode command line tools are switched to use the 4.3 versions:
如果您有 Xcode 4.3 或更高版本,则默认情况下不会安装命令行工具,例如 make。在 Xcode 首选项中,转到“下载”选项卡,然后在“组件”下按“命令行工具”旁边的“安装”按钮。成功下载并安装命令行工具后,您还应该在终端中键入以下命令,以确保所有 Xcode 命令行工具都切换为使用 4.3 版本:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Once everything is successfully installed you should see make
and other command line developer tools in /usr/bin.
一切安装成功后,您应该会make
在 /usr/bin 中看到其他命令行开发工具。
回答by Bart Verkoeijen
From torrey.lyons's answer, in Xcode --> Preferences --> Downloadsit says under Command Line Tools:
从torrey.lyons的回答中,在Xcode --> Preferences --> Downloads 中,它在Command Line Tools下说:
Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application.Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.
在安装之前,请注意,您可以在终端内使用 XCRUN 工具启动编译器和其他嵌入 Xcode 应用程序的工具。使用 XCODE-SELECT 工具来定义哪个版本的 Xcode 处于活动状态。在终端中输入“man xcrun”以了解更多信息。
Therefore, I was able to run the make tool with the command xcrun make
.
因此,我能够使用命令运行 make 工具xcrun make
。