Saturday, June 23, 2012

terminal missing gcc and g++

Usually I expect gcc and g++ to be automatically installed in my mac.  But it came to me as a surprise to find out that it was gone and missing.  I have lion and I had just upgraded to the latest Xcode.  In Xcode 4, I was able to run the c/c++ programs.  If this was the only way to do this then I would be mad at apple for giving me a handicap.

I figured that the reason for the absence was due to me decision to install only the minimum amount.  that is.... installing osx lion.  I did the minimum install rather then the regular one.  I felt like I had to somehow install all that extra stuff.  So I popped in my lion dvd and played around with it.  It wasn't there.  Sure there were a bunch of nice packages but unfortunately i had no clue what they did.  Instead of risking it and gambling the well being of my mac, I decided to search for a solution online.

which I found btw..... =)

basically the reason gcc was missing was because of the new way that apple decided to deal with Xcode.  They decided to make it one app and by doing so, they displaced all the necessary files in to the Xcode app.

To get my gcc back I had to go to

preferences > downloads > command line tools

and install the "command line tools"

I went back to the terminal and LO and behold.... it compiles =)

No comments:

Post a Comment