Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined symbols for architecture armv7 after importing RNCryptor

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.

like image 850
Regan Avatar asked Jul 23 '12 20:07

Regan


1 Answers

Make sure to add the Security framework:

#import <Security/SecRandom.h>
like image 196
Imirak Avatar answered Oct 05 '22 13:10

Imirak