我下载了河豚引用源代码here然后,当我尝试使用它时,我很好地导入了“blowfish.h”并为“blowfish.lib”设置了目标引用。
当我声明我的 key 时:
BF_KEY *key;
它工作得很好,但是一旦我调用“blowfish.h”中定义的方法,如下所示:
const char *keyStr = [HP_APP_KEY UTF8String];
BF_set_key(key, strlen(keyStr),(unsigned char*)keyStr);
尝试构建项目时出现此错误:
Undefined symbols for architecture i386: "_BF_set_key", referenced from: -[HPNetworkController authenticateUser:withPassword:] in HPNetworkController.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status
欢迎任何帮助,谢谢大家;)
最佳答案
据我了解,“引用源代码”不包含 iOS 库。 .lib
是 win32 库常用的扩展名。事实上,如果你尝试:
lipo -info blowfish.lib
您将收到一条错误消息。
所以,我认为你应该自己为 iOS 编译blowfish 并将其链接到你的项目。
关于iphone - 使用导入的用于密码加密的 Blowfish C 库构建 iPhone 项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6989369/