Apple M1上的Xcode显示“在为iOS构建的对象文件中链接”。或&quot“ LD:警告:未找到选项目录”。或找不到框架。
我正在尝试使用XCode最新(13.4.1)版本在M1处理器MacBook Pro上编译“ WebViewGold” iOS应用程序。
我非常努力地为那些Xcode错误代码找到解决方案。
我在主题中浏览了相关的答案,例如:为iOS模拟器构建,但在为iOS构建的对象文件中链接, https://stackoverflow.com/questions/32687105/framework-not-found-in-in-xcode,https://stackoverflow.com/questions/questions/9458739/9458739/ld-warning-warning-directory-not-not-not-found-for-for-for-for-option < /a>。
以上答案中没有提到任何东西!
对我该怎么办?
I am trying to compile a "WebViewGold" ios app on an M1 processor MacBook Pro, using XCode latest (13.4.1) version.
I have greatly struggled to find a solution to those XCode error codes.
I have browsed related answers in threads like: building for iOS Simulator, but linking in object file built for iOS, https://stackoverflow.com/questions/32687105/framework-not-found-in-xcode,https://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option.
Nothing mentioned in the above answers worked!
Any idea about what I should do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能会有一个非常此答案提供的简单解决方案。
基本上,在Apple硅驱动的Mac上运行的Xcode(例如13.4.1)的新鲜升级版本(例如我的M1 MacBook Pro),其组件无法在所有需要的所有输出平台组合中正确使用/输出适当的对象文件, 。
这导致了一些“有趣”的问题和错误消息交叉,这些问题在Stackoverflow上找到了“几乎正确”的答案。因此,从构建选项中排除“ ARM64”平台的许多建议。
所有这些的简单答案就是...仅启用Rosetta运行Xcode。罗塞塔(Rosetta)将与错过所需的跨平台功能的组件进行互动。
这是如何启用应用程序使用Rosetta的示例。
您选择应用程序图标,然后转到“文件”菜单,然后选择“获取信息”。
然后单击“使用Rosetta打开”复选框。
There is a possible, very simple solution provided by this answer.
Basically, freshly upgraded versions of XCode (for example, 13.4.1) running on Apple Silicon-powered Macs (like my M1 MacBook Pro), have components that cannot properly use/output the appropriate object files in all the output platform combinations you need.
This leads to some "interesting" issues and error message cross-overs that find "almost correct" answers on StackOverflow. Hence the many suggestions to exclude "arm64" platform and similar from the build options.
The simple answer to all of that is... to just run XCode with Rosetta enabled. Rosetta will engage with the components that miss the needed cross-platform capabilities.
Here is an example of how to enable an application to use Rosetta.
You select the app icon, then go to the File menu and select "Get Info".
Then click the "Open using Rosetta" checkbox.
至少在调试模式下,似乎确实只构建主动体系结构=否是问题。我可以成功制作一个发行档案,所以我建议除非您尝试调试英特尔版本,否则我建议不要独自一人。尝试图书馆,因为您可以以这种方式运送二进制文件。
It does seem that Build Active Architectures Only = NO is the issue, at least in Debug mode. I can successfully produce a Release archive, so I'd suggest just leaving it alone unless you're trying to debug the Intel version. Try a library, as you can ship the binary that way.