ryanwold.net

A civic-minded citizen seeking the singularity

An entry

C++ Compilers on the 2nd Gen Macbook Air

Date: 2012-09-08
Status: draft
Tags: homebrew osx programming troubleshooting

I bought a Macbook Air. My first Apple PC, a laptop. I couldn't resist. It's a beautiful machine. It feels great. It runs its own flavor of *.nix and its not Windows. Two pluses in my book.

I installed Homebrew so I could easily use MongoDB and other 'brew' packages, such as 'gdal', for geospatial boundary files (like the shapes of the 50 States).

But, when running 'brew install gdal', I got a crazy compiler error. Bummer. After much research, I learned about the C compilers installed in OSX Lion and read countless recommendations to re-install XCode 4.1.

To resolve the issue, I had to change some local symlinks.

My links in the /usr/bin directory now look like they do below.

Type the terminal command ls -lA to see all files.

c++ -> llvm-g++-4.2

cc -> llvm-gcc-4.2

g++ -> /usr/bin/g++-4.2

gcc -> /usr/bin/gcc-4.2

llvm-cpp-4.2 -> /usr/bin/llvm-gcc-4.2/bin/llvm-cpp-4.2

llvm-g++ -> /usr/bin/llvm-gcc-4.2/bin/llvm-g++4.2

llvm-g++-4.2 -> /usr/bin/llvm-gcc-4.2/bin/llvm-g++-4.2

llvm-gcc -> /usr/bin/llvm-gcc-4.2/bin/llvm-gcc-4.2

llvm-gcc-4.2 -> /usr/bin/llvm-gcc-4.2/bin/llvm-gcc-4.2