简体   繁体   中英

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.

I'm trying to install lupa: a bridge between Lua and 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.

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??". 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. I believe my Mac has GCC version 4.2.1. I tried to download a version of GCC 4.0, but couldn't find a download link to do so. 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). I have the latest version of XCode (version 4 I believe it is). Nothing seems to work.

When I run the command gcc-4.2 , I get 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 .

I get a lot of problems on the command line with my 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. 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.

Thanks!

Sounds like gcc-4.2 is installed? Possibly can link this to be called when the installer looks for gcc-4.0.

To check for the location of gcc , do

ls -l $(which gcc)

On my system, this shows that gcc is a symlink to 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...

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

Note that this command is different from the one you showed in the comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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