Thursday, December 19, 2013

Qt 5.2 on Mac OS X

I had mixed experiences trying to install Qt 5.2 on two different Macs (both running the same version of OS X): on my personal computer the install went on with no trouble.  I ran an update using Qt's maintenance tool app, and then the package manager in the same app to select the bits of Qt 5.2 I wanted to install; my work computer, on the other hand, game me a lot of trouble. So, for future reference, here's how I got it working.

Problem 1 – Update did not complete

The update process was failing with an error pertaining to the system not being able to save the Updates.xml file due to it already existing. As far as I could determine, the update app creates a temporary directory for each repository—at /var/folders/rb/[random string]/T/remoterpo[some ref. code]meta/—and saves Update.xml file in there, before listing all the available updates. Due to either a bug in the maintenance app or an incorrect update package, one of the repositories was causing this error.

Solution

On the maintenance app's main window, select Update Components, then Settings, then Repositories, and turn everything off except for one, the Maintenance Tool online repos.  Run the update, and that should complete with an updated maintenance app. Then re-run the update process with all repositories selected, and it should go to completion. After this point you should be able to restart the app, select Package manager, and the Qt 5.2 packages should show. That leads into the next problem I encountered.

Problem 2 – Installation fails

The installation process either via the maintenance tool or using the installers from the Qt website fails some time midway with the message "Command install_name_tool failed," followed by a list of arguments to the command.

Solution

If you search the web for solutions you will certainly bump into posts asking "Have you updated Xcode?".  Well, I had. But there's more to it. On my work computer I had to install the Xcode Command Line Tools, which can be found in the Xcode preferences, under Downloads. Once I completed this step, the install worked fine. Strangely, this step was not required in my home computer (same OS X version): I just checked, Xcode Command Line Tools are not installed. Go figure.

No comments: