2

On my previous computer I had Xcode working nicely; on my present computer, with Homebrew installed, gcc and make are present in /Developer/usr/bin but not /usr/bin. On the whole when I try to download and build http://JonathansCorner.com/download/tms1_4.tar.gz, I can find bits and pieces of the tools used to do things, but when invoked from its present path it doesn't recognize #include <stdio.h> type includes.

How can I reinstall Xcode, Homebrew, and anything else to get a fresh and working build so I can run make && make install?

3

Reinstalling XCode and updating Homebrew should be enough. To do this:

  • Try the uninstall-devtools script from this answer to remove older XCode versions. (If it doesn't work or you can't find it, don't worry about it.)
  • Delete the entire /Developer directory if it exists. This is where older versions of XCode live.
  • Download and install the latest XCode for your OS version. (The App Store makes this easy.)
  • Install the Command Line Tools. In XCode, go to the Apple menu, select Preferences, select the Downloads section, and click Install next to Command Line Tools.
  • Update the Homebrew definitions and packages with brew update && brew upgrade.
    • If any brewed packages still seem broken, brew rm them and brew install --fresh to reinstall.
  • Edit your shell config file (e.g. ~/.bashrc) to make sure /usr/local/bin is on your path. brew doctor can help diagnose this and other issues.

Note that tms is designed to install to /usr/lib by default, which you won't have permissions to do in a normal OS X setup even once you have all the tools installed, because the OS reserves /usr for its own use. You'll probably want to fiddle with the Makefile and tms.h to get it in to /usr/local or /opt, which are easier places to drop user-built packages.

If you're feeling ambitious, you could even do brew create http://jonathanscorner.com/download/tms1_4.tar.gz to make a Homebrew formula for TMS, making repeated installs easier.

  • 2
    Very good advice. I might make a plug to run the perl script that uninstalls the packages and then files that were installed from Xcode. It's slightly cleaner, but won't touch your code or libraries - just cleans the Apple tools and directories. – bmike Apr 25 '13 at 19:15
  • That's a good idea, for hygiene. Adding that as an item in my answer. – Andrew Janke Apr 25 '13 at 19:20
  • Now that's a great answer. If only I had more than one up vote. – bmike Apr 25 '13 at 19:37
  • Aw shucks, now you're making me blush. – Andrew Janke Apr 25 '13 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .