Skip to content
kaelin edited this page Apr 18, 2013 · 8 revisions

Check here for answers to frequently asked questions.

My CocoaPod won't install… Why?

[!] Unable to locate the executable hg

vMAT uses eigen (so one of its dependencies is the eigen CocoaPod), and eigen is hosted on BitBucket using the Mercurial distributed version control system. Mercurial does not come pre-packaged with Xcode like Git does, so you have to install it another way.

I like to use Homebrew:

[!] Unable to locate the executable `hg`
aoide:vMAT kaelin$ brew install hg
==> Downloading http://mercurial.selenic.com/release/mercurial-2.5.2.tar.gz
######################################################################## 100.0%
==> make local
==> Caveats
Extensions have been installed to:
  /usr/local/opt/mercurial/libexec/hgext

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/mercurial/2.5.2: 531 files, 7.1M, built in 12 seconds

[!] The platform of the target Pods (OS X 10.6) is not compatible with vMAT (0.0.1) which has a minimum requirement of OS X 10.8.

The CocoaPods quick-start instructions neglect to mention how you specify which OS version your targeting. Here is the secret sauce:

ohm:HelloPods kaelin$ cat PodFile 
platform :osx, '10.8'
pod 'vMAT', '~> 0.0.1'
ohm:HelloPods kaelin$ pod install 
Analyzing dependencies
Downloading dependencies
Installing BlocksKit (1.8.1)
Installing boost (1.51.0)
Installing eigen (3.1.2)
Installing vMAT (0.0.1)
Generating Pods project
Integrating client project

[!] From now on use `HelloPods.xcworkspace`.

My Xcode workspace isn't right… Why?

Workspace Integrity

HelloPods.xcworkspace Integrity

Xcode doesn't like it if you try to open the same project in a workspace and stand-alone. And Xcode does like to re-open projects that you had open last time it was running. So, carefully close all of your project windows, then quit Xcode, then relaunch it and open only your new workspace.

Errors linking to std::*… Sooo many errors!

HelloPods.xcworkspace Link Errors

In the case shown above, the brand-new HelloPods project's executable target didn't include any C++ source files; so Xcode didn't link in libc++. But vMAT uses libc++, and so… hilarity ensues. Fixing it in this case was as simple as renaming the default main.m to main.mm, but adding any C++ or Objective-C++ sources to your project will do the trick.

A more problematic case may occur if CocoaPods isn't able to propagate the correct build settings for some reason. If you do have C++ sources in your project and you see this error, comb through the Apple LLVM compiler 4.2 - Language settings of all your targets to make sure all of them are linking against libc++ (LLVM C++ standard library with C++11 support).

githalytics.com alpha