Iphone simulator (linker command failed with exit code 1 (use -v to see invocation))

帅比萌擦擦* 提交于 2019-12-11 11:38:55

问题


I am using Unity to build iPhone game. When I build for iPhone simulator I got this annouing error: I tried to build for iOS 4.2 and later versions... but no hope..

ld: -pie can only be used when targeting iOS 4.2 or later
clang: error: linker command failed with exit code 1 (use -v to see invocation)

回答1:


The issue is likely that you are trying to link a static archive that was built against the OS X SDK into your iOS Simulator executable. Previous versions of Xcode's toolchain did not guard against this (which can lead to various runtime issues where there are binary incompatibilities between the two platforms).

Your clock$UNIX2003 implementation hack is simply masking the larger issue.

You need to get a version of that library built against the iOS Simulator SDK for use in the iOS Simulator.




回答2:


I finally Found a work around ! form this post : http://forum.unity3d.com/threads/ios8-xcode6-compatibility.249533/page-2

just add this code to the end of main.mm in Xcode project

#include <time.h>

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


来源:https://stackoverflow.com/questions/25998545/iphone-simulator-linker-command-failed-with-exit-code-1-use-v-to-see-invocati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!