OS X Lion 安装后./configure 找不到 C 编译器
虽然 cc
和 gcc
完全位于正确的路径(OS X Lion 中的 /Developer/usr/bin
),但运行 ./ configure
尝试通过硬编码(我猜)路径 - /usr/bin
来编译它。
在哪里设置配置路径?
While cc
and gcc
are perfectly in their right path (/Developer/usr/bin
in OS X Lion), running ./configure
tries to compile it through a hard coded (I guess) path - /usr/bin
.
Where do I setup configure's paths?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
正确的答案是从 App Store(免费)安装 Xcode 4,然后运行 /Applications/Install Xcode.app。然后你需要的一切都将在 /usr/ 中。
The right answer is to install Xcode 4 from the App Store (free) and then run /Applications/Install Xcode.app. Then everything you need will be in /usr/.
最好的办法实际上是从 Apple 下载并安装新的命令行开发工具包,它为您提供了 /usr/bin 中的工具以及适当位置的库和文档(例如手册页)。可以在developer.apple.com上找到它,或者检查此处了解详细信息和链接。
The best thing to do is actually to download and install the new Command Line Developer Tools package from Apple, which gives you your tools in /usr/bin along with libraries in the proper place and documentation (e.g. manpages). Either go find it on developer.apple.com or check here for details and a link.
我刚刚遇到了这个...我通过安装 XCode“命令行工具”包“解决”了它
但是由于某种原因,当项目打开时不可能(至少对我来说)到达相同的首选项窗口。我必须执行以下操作:
,
下载
安装
I just ran into this... I "solved" it by just installing the XCode "Command Line Tools" package
But for some reason it is not possible (for me at least) to reach the same preferences window when a project is open. I had to do the following
,
Downloads
install
njamesp 是正确的;解决您问题的正确方法是正确安装编译器工具链。但对于在哪里设置配置路径?这个问题,有几个解决方案。
将其作为命令行选项传递到配置:
/path/to/configure CC=/p/a/t/h
(已弃用的 bourne shell)将其传递到环境中:
CC=/p/a/t/ h /p/t/配置
(Deprecated-csh)
env CC=/ p/a/t/h /p/t/configure
设置一个配置.站点。将
CONFIG_SITE
放入您的环境中作为文件的路径,(例如导出
CONFIG_SITE=$HOME/config.site
),将CC=/p/a/t/h
放入该文件put
CC= /p/a/t/h
在/usr/local/share/config.site
中
所有这些都假设您的配置脚本是由 autoconf 生成的。不鼓励使用选项 2 和 3,但如果您的配置脚本很古老,则选项 1 可能不起作用。选项 5 很灵活,您可以根据前缀使用不同的 config.sites。 $prefix/share/config.site 可用于设置安装在
$prefix
中的项目的选项。njamesp is correct; the proper solution to your problem is to get your compiler tool chain correctly installed. But to the question Where do I setup configure's paths?, there are a couple of solutions.
Pass it to configure as a command line option:
/path/to/configure CC=/p/a/t/h
(Deprecated-bourne shell) Pass it in the environment:
CC=/p/a/t/h /p/t/configure
(Deprecated-csh)
env CC=/p/a/t/h /p/t/configure
setup a config.site. Put
CONFIG_SITE
in your environment as the path of a file,(eg export
CONFIG_SITE=$HOME/config.site
), putCC=/p/a/t/h
in that fileput
CC=/p/a/t/h
in/usr/local/share/config.site
All of this assumes that your configure script was generated by autoconf. Options 2 and 3 are discouraged, but if your configure script is ancient option 1 may not work. Option 5 is flexible, and you can use different config.sites depending on prefix. $prefix/share/config.site can be used to set options for projects installed in
$prefix
.第 1 条正确:我刚刚做了同样的事情。
编译器安装在 /usr/bin
cd 中,然后输入“gcc -v”(不带引号),您应该得到以下结果:
Item 1 correct: I just did the same thing.
The compilers are install in /usr/bin
cd there, and type
"gcc -v"
(without the quotes)and you should get back the following:我最近安装了 OSX Mavericks 并想升级到 php 5.5.5 并面临类似的问题
查看我的包含路径,我注意到只添加了 de base Xcode 路径(我有 Xcode 5)
我所需要做的就是添加路径到工具链
瞧,它找到了。
希望这有帮助。
I recently installed OSX Mavericks and wanted to upgrade to php 5.5.5 and faced a similar issue
Looking at my include path, I noticed that only de base Xcode path was added (I have Xcode 5)
All I needed to do is add the path to the Toolchains
And voilà, it found it.
Hope this helps.