1
1

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.

Unityで"_clock$UNIX2003"がないよ@Xcode6シミュレーター

Last updated at Posted at 2014-10-23

Unity Version4.5.4f1でiOS用のアプリをシミュレーターで動かそうとしたところ、
i386には"_clock$UNIX2003"ないよと怒られた。
ちなみにXcodeは6.0.1。

Undefined symbols for architecture i386:
  "_clock$UNIX2003", referenced from:
      _substanceHandleSwitchHard in libiPhone-lib.a(apihandle.o)
      _mainRenderProcess in libiPhone-lib.a(mainrenderprocess.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

こちらのフォーラムでUnityの人が下記をmain.mmに追加すればイケるって書いてたのでやってみた。

main.mm
#include <time.h>

extern "C"
{
    clock_t
    clock$UNIX2003(void)
    {
        return clock();
    }
}

イケた。
けどこれっていいのかな(´・ω・`)

追記

Unity Version4.5.5f1にアップデートしたら発生しなくなってた。
これが追加されたっぽい。

main.mm
#if TARGET_IPHONE_SIMULATOR
extern "C" clock_t clock$UNIX2003(void) { return clock(); }
#endif // TARGET_IPHONE_SIMULATOR
1
1
2

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?