0

我正在尝试实现我在项目中发现的 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)

请让我知道我应该如何处理这个错误。

提前致谢。

4

1 回答 1

1

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

于 2012-07-18T19:48:06.617 回答