报错: Undefined symbols for architecture arm64:
这个经常会遇到,现在整理下来
1.
<pre class="lang-c prettyprint" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 5px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; overflow: auto; width: auto; max-height: 600px; background-color: rgb(238, 238, 238);">这种情况一般是库引用的问题,解决办法<span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">选择工程的TARGETS-->Build Phases-->Link Binary With Libraries 点击“+”图标添加对应的库。</span>
<span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">或者 编译时候找不到对应的类,所以需要我们在Build Phases-->Compile Sources中手动添加XXX.m 以及</span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">XXX</span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px; background-color: rgb(240, 240, 240);">.m两项,之后clean项目,重新编译即可。</span>
2.
//http://stackoverflow.com/questions/19213782/undefined-symbols-for-architecture-arm64 ()
The issue is that the cocoapods have not been built for arm64 architecture yet thus they cannot be linked when you build them. Likely you cannot use those packages until they are updated and use that architecture. You can fix the linker error by going to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s.
问题在于cocoapods尚未建立arm64建筑因此不能当你建造有关。可能你不能使用这些包,直到他们更新和使用该架构。你可以修复链接器错误,将项目- >目标(项目名称)- >构建设置和改变架构标准架构(v7,v7)和有效的架构v7,v7。去掉arm64留armv7和armv7s
Note though, this means you won't get the full power of the 64 bit processor. You said you are building for the 5s, so there may be some reason you need this. If you for some reason absolutely need that power (perhaps you are building a game), and desperately need those files, you could submit a pull request and then recompile the project to arm64 by setting those same fields to arm64 in the files you pulled from the open source projects. But, unless you really need these files to be 64 bit compatible, that seems like a bit of overkill for now.
注意,这意味着你不会得到64位处理器的全部威力。你说你正在建立5 s,所以可能会有一些原因你需要这个。如果你因为某些原因绝对需要这种力量(也许你正在构建一个游戏),并迫切需要这些文件,你可以提交一个请求,然后重新编译项目arm64通过设置这些字段的arm64文件从开源项目。但是,除非你真的需要这些文件64位兼容,这好像有点大材小用了。
EDIT: Some people also reported that setting Build For Active Architectures to YES was also necessary to solve this problem.
有些人还说,Build For Active Architectures = yes 也可以解决这个问题。