5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unity4.3で__curOrientationが見つからないとかいうエラーが出る

Posted at

はじめに

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個の間違いのようです。)

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?