架构i386和armv7的Openssl Mach-O链接器错误

时间:2012-07-17 15:22:46

标签: xcode architecture error-handling linker openssl

我正在尝试实现我在项目中找到的openssl代码,但是我得到的这些链接器错误并没有消失。我检查了框架是否正确链接,甚至手动使用../lib和../include包含库和标题搜索路径。尽管如此,当我摆脱Openssl函数或任何函数调用(例如EVP_OpenUpdate或EVP_OpenInit)时,错误消失了。这只有在我创建然后出于某种原因从我的ViewController.h文件中调用该函数时才会这样。

以下是错误的日志:

  Ld /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL normal armv7
cd /Users/User/Documents/LineaSSL
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv  PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/iPhoneOS5.1.sdk -L/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -L/Users/User/Documents/LineaSSL/../../Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/../../Downloads/DTDevices-iOS_2012-06-15_v1/Library -L/Users/User/Documents/LineaSSL/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/lib -F/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -Finclude -Finclude/openssl -filelist /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Intermediates/LineaSSL.build/Debug-iphoneos/LineaSSL.build/Objects-normal/armv7/LineaSSL.LinkFileList -dead_strip -miphoneos-version-min=4.0 -lcrypto -lssl -framework CoreGraphics -framework ExternalAccessory -framework Foundation -framework UIKit -ldtdev -o /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL

ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libssl.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
 "_rsa_open3", referenced from:
   -[ViewController barcodeData:isotype:] in ViewController.o
 ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请告诉我应该对此错误做些什么。

提前致谢。

1 个答案:

答案 0 :(得分:1)

我必须从头开始重建整个项目才能让它发挥作用。我不知道为什么我不得不做这样的事情。