64 位模拟器的 Xcode Mach-O 链接器错误 [英] Xcode Mach-O Linker errors with 64-bit simulator

查看:23
本文介绍了64 位模拟器的 Xcode Mach-O 链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在用 Xcode 开发一个 iOS 应用程序.它在常规模拟器中编译并完美运行,但是当我将模拟器设备切换到 64 位时,它失败了 13 个新警告和 37 个新错误,所有这些都与我正在使用的外部库相关联(我认为)称为 ObjectiveDDP(

如果没有,您可以在没有 64 位支持的情况下编译自己的应用程序.

64 位刚刚添加到 Xcode 5.1 的默认设置中.您可以将自己项目中的架构设置为 $(ARCHS_STANDARD_32_BIT) 以将其删除并返回到 5.0 行为.

I have been developing an iOS app in Xcode. It compiled and ran perfectly in the regular simulator, but when I switched the simulator device to 64-bit, it failed with 13 new warnings and 37 new errors, all of which are associated (I think) with an external library I'm using called ObjectiveDDP(https://github.com/boundsj/ObjectiveDDP). People had similar problems, but my understanding is they were supposedly fixed in a recently-released update to the framework, but on my end this update is to no avail. A second framework I'm using is SocketRocket (https://github.com/square/SocketRocket), but I don't think this is the culprit given Xcode's output.

Additionally, it is clear that many people have had such Mach-O errors arrive from frameworks not compatible with 64-bit. However, I feel like this is an issue with the organization of my files. That being said, I also believe that the overarching issue is this: Ignoring file /path/to/project/ObjectiveDDP/libcrypto.a, missing required architecture x86_64 in file /path/to/project/ObjectiveDDP/libcrypto.a. Is there a way to fix this issue in that file by adding that architecture? Per an answer to a similar question, I have tried changing my Build Settings architecture to Standard architectures(armv7, armv7s, arm64) and have rechecked that other dependencies are all met.

Here is a portion of the error:

Undefined symbols for architecture x86_64:
  "_BN_CTX_free", referenced from:
      _srp_verifier_new in srp.o
      _srp_user_start_authentication in srp.o
      _meteor_user_generate_kgx in srp.o
      _meteor_user_generate_aux in srp.o
      _meteor_user_generate_S_string in srp.o
  "_BN_CTX_new", referenced from:
      _srp_verifier_new in srp.o
      _srp_user_start_authentication in srp.o
      _meteor_user_generate_kgx in srp.o
      _meteor_user_generate_aux in srp.o
      _meteor_user_generate_S_string in srp.o
      _srp_user_process_meteor_challenge in srp.o
  "_BN_add", referenced from:
      _srp_verifier_new in srp.o
      _meteor_user_generate_aux in srp.o
  "_BN_bin2bn", referenced from:
      _srp_verifier_new in srp.o
      _H_nn in srp.o
      _meteor_user_generate_u in srp.o
      _meteor_user_generate_x in srp.o
      _meteor_user_generate_k in srp.o
      _meteor_user_generate_M_string in srp.o
      _meteor_user_generate_HAMK in srp.o
      ...

And a screenshot of what the error looks like in Xcode:

After my research I still am wondering if this is just a simulator issue and it'll resolve itself when tested on a physical iPhone 5S, and also simply how I can get rid of these errors? Does anything here suggest a file organizational issue? Two other warnings are:

ld: warning: directory not found for option '-L/path/to/place/projectname/projectname/ObjectiveDDP' ld: warning: directory not found for option '-L/path/to/place/projectname/SocketRocket/ObjectiveDDP'

And these two paths don't exist, but I thought I corrected it by deleted the folders, moving them to the trash, and re-adding them.

Any insight would be greatly appreciated.

解决方案

It looks like libcrypto.a included with your ObjectiveDPP package is not compiled for 64-bit arch. If you need 64-bit, this answer looks like it will help you to get that file:

Where I can find openssl iOS 7 libcrypto.a and libssl.a static library for arm64 architecture

If not, you can just compile your own app without 64-bit support.

64-bit was just added to the defaults in Xcode 5.1. You can set your architecture in your own project to $(ARCHS_STANDARD_32_BIT) to remove it and go back to the 5.0 behavior.

这篇关于64 位模拟器的 Xcode Mach-O 链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆