简体   繁体   English

找不到gcc-4.0命令OS X

[英]gcc-4.0 command not found OS X

Please don't mark this as a duplicate. 请不要将此标记为重复项。 Chances are I've already tried the question you're going to link to, and had no luck. 我可能已经尝试过要链接到的问题,并且没有运气。 I've looked through at least 50 questions on this, and can't seem to fix this error. 我已经浏览了至少 50个问题,似乎无法解决此错误。

I'm trying to install lupa: a bridge between Lua and Python. 我正在尝试安装lupa:Lua与Python之间的桥梁。 Don't ask why xD Anyway, when I run the setup.py command, it runs fine, finds my LuaJIT2 installation, etc etc, but when it tries to run the command "gcc-4.0", it doesn't work. 不要问为什么xD无论如何,当我运行setup.py命令时,它运行得很好,找到了我的LuaJIT2安装文件,等等,但是当它尝试运行命令“ gcc-4.0”时,它不起作用。

I didn't know what GCC was until a few days ago, so when it says something about GCC I was like "What the heck is GCC??". 直到几天前我才知道GCC是什么,所以当它谈到GCC时,我会说“ GCC到底是什么??”。 So, I spend my time researching it and found out it was a C/C++ compiler (though I think the C++ one is called G++ or something, but GCC can compile C++ as well I believe) and that makes sense, since lupa uses Cython. 因此,我花了很多时间研究它,发现它是一个C / C ++编译器(尽管我认为C ++被称为G ++之类的东西,但我相信GCC也可以编译C ++),而且这很有意义,因为lupa使用Cython。 。 I believe my Mac has GCC version 4.2.1. 我相信我的Mac拥有GCC 4.2.1版本。 I tried to download a version of GCC 4.0, but couldn't find a download link to do so. 我尝试下载GCC 4.0版本,但是找不到下载链接。 I have tried installing XCode Command Line Tools and that didn't do any good (I already had them installed, so I uninstalled and reinstalled hoping that would work). 我尝试安装XCode命令行工具,但效果不佳(我已经安装了它们,所以我卸载并重新安装了希望能起作用的)。 I have the latest version of XCode (version 4 I believe it is). 我拥有最新版本的XCode(我相信它是4版)。 Nothing seems to work. 似乎没有任何作用。

When I run the command gcc-4.2 , I get i686-apple-darwin11-gcc-4.2.1: no input files . 当我运行命令gcc-4.2 ,我得到了i686-apple-darwin11-gcc-4.2.1: no input files

When I run the command gcc-4.0 , I get bash: gcc-4.0: command not found . 当我运行命令gcc-4.0 ,我得到了bash: gcc-4.0: command not found

I get a lot of problems on the command line with my Mac. Mac的命令行上出现很多问题。 Homebrew doesn't work for me, git doesn't work for me, curl doesn't work for me, ssl doesn't work for me, and now GCC is being very on-and-off. Homebrew对我不起作用,git对我不起作用,curl对我不起作用,ssl对我不起作用,现在GCC处于断断续续的状态。 I have made questions about this before, and had no help. 我以前对此提出过疑问,没有帮助。

If it's any help, I'm using a base model mid-2012 MacBook Pro 13" non-retina display. 如果有帮助,我正在使用2012年中推出的基本型号MacBook Pro 13英寸非视网膜显示器。

Thanks! 谢谢!

Sounds like gcc-4.2 is installed? 听起来像gcc-4.2已安装? Possibly can link this to be called when the installer looks for gcc-4.0. 当安装程序寻找gcc-4.0时,可以链接此链接来调用。

To check for the location of gcc , do 要检查gcc的位置,请执行

ls -l $(which gcc)

On my system, this shows that gcc is a symlink to llvm-gcc-4.2 : 在我的系统上,这表明gcc是到llvm-gcc-4.2的符号链接:

lrwxr-xr-x  1 root  wheel  12 Aug 13  2012 /usr/bin/gcc@ -> llvm-gcc-4.2

If that doesn't show anything, try: 如果没有显示任何内容,请尝试:

ls -l $(which gcc-4.2)

Whichever of those shows output, put that which statement exactly into this command... 无论哪个显示输出,都将which语句准确地放入该命令中...

sudo ln -s $(which gcc) /usr/bin/gcc-4.0

Note that this command is different from the one you showed in the comments. 请注意,此命令与您在注释中显示的命令不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM