はじめに
Unity4.2 + Vuforiaで作成したプロジェクトを、Unity4.3に移行してビルドすると以下のようなエラーがでる。(Vuforiaが関係してるかどうかは未確認。)
Undefined symbols for architecture armv7: "__curOrientation", referenced from: -[UnityAppController application:didFinishLaunchingWithOptions:] in UnityAppController.o
これは、以下のサイトを見ると、__curOrientationがstaticで宣言されているせいで出るようだ。
解決策
前述のサイトによると、解決策は、
その1(手動)
XCode上で、iPhone_View.mmファイルの中の
iPhone_View.mm
static ScreenOrientation _curOrientation = orientationUnknown;
という行を、
iPhone_View.mm
ScreenOrientation _curOrientation = orientationUnknown;
というようにstaticをはずせば良いようだ。
その2(自動)
また、自動で変更する方法として、Unityプロジェクトの中の
Assets/Editor/PostProcessBuildPlayer
というファイルの367行あたりの
PostProcessBuildPlayer
if line.strip()[0:40] == 'static ScreenOrientation _curOrientation':
という行を、
PostProcessBuildPlayer
if line.strip()[0:40] == 'static ScreenOrientation _curOrientation' or line.strip()[0:40] == 'static ScreenOrientation _curOrientation':
に書き換えれば、後はビルドしたときに自動で変更してくれる。
(前述のサイトの変更後のソースをコピーすると、_curOrientationの前に、スペースが2つ入っているが、これはタブ1個の間違いのようです。)