xcode 链接器命令失败,退出代码为 1 xcode4.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12534334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:33:57  来源:igfitidea点击:

linker command failed with exit code 1 xcode4.5

iosxcodedebugging

提问by user1491987

I updated my iphone4s and xcode to the latest yesterday. And I'm trying to debug my app on my phone since my application uses hardware communication. I'm using a third party library from Redpark(the company provides Dock to RS232 wire.) While compiling, it gives an error

我昨天更新了我的 iphone4s 和 xcode 到最新的。我正在尝试在手机上调试我的应用程序,因为我的应用程序使用硬件通信。我正在使用 Redpark 的第三方库(该公司提供 Dock 到 RS232 线。)在编译时,它给出了一个错误

ld: file is universal (2 slices) but does not contain a(n) armv7s slice:/Users/...../libRscMgrUniv.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone know how to solve this except waiting for Redpark to update there library?

除了等待 Redpark 更新那里的库之外,有没有人知道如何解决这个问题?

回答by AliSoftware

You can simply disable the compilation of armv7sin your Build Settings, by replacing the $VALID_ARCHITECTURES(which evaluates to armv7 armv7snow) value by the explicit value armv7.

您可以简单地禁用armv7s构建设置中的编译,方法是将$VALID_ARCHITECTURES(计算为armv7 armv7s现在的)值替换为显式值armv7

Thus your application will only build for armv7and not armv7s, so will not be fully optimized for the new iPhone5, but it will still run on iPhone 4 and 5 anyway (the armv7sprocessor of the iPhone 5 can execute armv7applications, it is just not as optimized as with armv7sprocessor dedicated instructions)

因此,您的应用程序只会为armv7而非构建armv7s,因此不会针对新的 iPhone5 进行全面优化,但它仍然可以在 iPhone 4 和 5 上运行(iPhone 5 的armv7s处理器可以执行armv7应用程序,只是没有优化带有armv7s处理器专用指令)

回答by user1491987

I did another search and found two solutions work for me. Dafna1. Go to Target Setting -> Build Settings -> Build Active Architecture Only -> change to NO. 2. Still in Build Settings -> Valid Architecture -> delete armv7s.

我进行了另一次搜索,发现有两种解决方案对我有用。 Dafna1. 转到目标设置 -> 构建设置 -> 仅构建活动架构 -> 更改为否。2.还是在Build Settings -> Valid Architecture -> delete armv7s。

They both work for me. If you have the same problem, definitely try this first.

他们都对我来说有效。如果你有同样的问题,一定要先试试这个。