Undefined symbols for architecture armv7 after importing RNCryptor

陌路散爱 提交于 2019-12-07 06:38:33

问题


I imported RNCryptor, which can be found here: https://github.com/rnapier/RNCryptor into my app. However, I've been getting three errors with this in the log.

Undefined symbols for architecture armv7:
  "_SecRandomCopyBytes", referenced from:
      +[RNCryptor randomDataOfLength:] in RNCryptor.o
  "_kSecRandomDefault", referenced from:
      +[RNCryptor randomDataOfLength:] in RNCryptor.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I saw that this is normally caused when imported classes are not included in the target, but I have already checked the build phases, and all imported classes are in there. I do not know what is causing this, I have not touched the code of any of these classes. I have also cleaned the target several times.


回答1:


Make sure to add the Security framework:

#import <Security/SecRandom.h>



回答2:


I had this issue even with the Security Framework included. I removed and re-included the framework to fix it.



来源:https://stackoverflow.com/questions/11619941/undefined-symbols-for-architecture-armv7-after-importing-rncryptor

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