Getting Mac OS Lion GCC to work again
Last week I made a mistake: I updated XCode from the Mac App Store, and suddenly gcc stopped working, with this error:
configure: error: C compiler cannot create executables
The strange thing was that gcc itself still can compile code, I tried with a stupid hello_world.c, but by looking at the logs of the software I was trying to install there was a strange output:
configure:3436: /usr/bin/gcc-4.2 s-g -02 conftest.c >&5
i686-apple-darwin11-gcc-4.2.1: s-g: No such file or directory
I guessed was something about compiler optimization, so I tried to turn off at all (-O0) and it worked:
$ CFLAGS=-O0 rbenv install 1.9.3-p194
Written by Luca Guidi
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mac
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#