链接器命令失败,退出代码为1(用户-v查看调用)(iOS 9)

时间:2015-10-22 18:54:27

标签: ios xcode swift

我一直在谷歌搜索上述错误四天,找不到适用于我的项目的解决方案。这是我的错误日志,如果有任何想法请回复。我想让我的项目运行。我正在从Xcode 6升级到Xcode 7到iOS 9。

Ld /Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Products/Debug-iphonesimulator/FirmaQuipux.app/FirmaQuipux normal i386
    cd "/Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal"
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Products/Debug-iphonesimulator -L/Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad\ 3/RESPALDOFirmaIpad/FirmaFinal -F/Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Products/Debug-iphonesimulator -filelist /Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Intermediates/FirmaFinal.build/Debug-iphonesimulator/FirmaFinal.build/Objects-normal/i386/FirmaQuipux.LinkFileList -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework AVFoundation -framework AudioToolbox -framework QuartzCore -framework Security -framework CoreGraphics -framework Foundation -framework UIKit -lcrypto -lchilkatIos -lssl -Xlinker -dependency_info -Xlinker /Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Intermediates/FirmaFinal.build/Debug-iphonesimulator/FirmaFinal.build/Objects-normal/i386/FirmaQuipux_dependency_info.dat -o /Users/pantelisnatsis/Library/Developer/Xcode/DerivedData/FirmaFinal-fgvuqoqtnzbydzfgwdnttvhzxftc/Build/Products/Debug-iphonesimulator/FirmaQuipux.app/FirmaQuipux

ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libcrypto.a, file was built for archive which is not the architecture being linked (i386): /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libcrypto.a
ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libchilkatIos.a, missing required architecture i386 in file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libchilkatIos.a (2 slices)
ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libssl.a, file was built for archive which is not the architecture being linked (i386): /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libssl.a
Undefined symbols for architecture i386:
  "_ASN1_STRING_data", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
      _CertificateGetInfo in MainViewController.o
      _CertificateGetExpiryDate in MainViewController.o
  "_ASN1_TIME_to_generalizedtime", referenced from:
      _CertificateGetExpiryDate in MainViewController.o
  "_ASN1_get_object", referenced from:
      _obtener_extension in MainViewController.o
  "_OBJC_CLASS_$_CkoCertStore", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_CLASS_$_CkoCrypt2", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJ_obj2nid", referenced from:
      _obtener_extension in MainViewController.o
  "_OBJ_obj2txt", referenced from:
      _obtener_extension in MainViewController.o
  "_OBJ_txt2nid", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
      _CertificateGetInfo in MainViewController.o
  "_X509_EXTENSION_get_data", referenced from:
      _obtener_extension in MainViewController.o
  "_X509_NAME_ENTRY_get_data", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
      _CertificateGetInfo in MainViewController.o
  "_X509_NAME_get_entry", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
      _CertificateGetInfo in MainViewController.o
  "_X509_NAME_get_index_by_NID", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
      _CertificateGetInfo in MainViewController.o
  "_X509_get_ext", referenced from:
      _obtener_extension in MainViewController.o
  "_X509_get_ext_count", referenced from:
      _obtener_extension in MainViewController.o
  "_X509_get_issuer_name", referenced from:
      _CertificateGetIssuerInfo in MainViewController.o
  "_X509_get_subject_name", referenced from:
      _CertificateGetInfo in MainViewController.o
  "_d2i_X509", referenced from:
      -[MainViewController ejecutarAccion:::::::] in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

3 个答案:

答案 0 :(得分:2)

您的应用程序链接了一些库,其中没有i386体系结构切片。这些是它抱怨的图书馆:

  • libcrypto.a
  • libchilkatIos.a
  • libssl.a

您需要包含这些库的版本,其中包含目标所有架构的机器代码(模拟器是i386或x86-64,iOS设备将是一些arm指令集,如arm7vs或arm64),或者你需要限制目标的体系结构以匹配依赖库中的可用内容。

答案 1 :(得分:1)

有三个链接器警告,15个架构i386的未定义符号。

ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libcrypto.a, file was built for archive which is not the architecture being linked (i386): /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libcrypto.a
ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libchilkatIos.a, missing required architecture i386 in file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libchilkatIos.a (2 slices)
ld: warning: ignoring file /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libssl.a, file was built for archive which is not the architecture being linked (i386): /Users/pantelisnatsis/Downloads/RESPALDOFirmaIpad 3/RESPALDOFirmaIpad/FirmaFinal/libssl.a
libcrypto.a, libchilkatIos.a, libssl.a

最后的错误是相当自我解释的:

ld:找不到架构i386的符号

这些是i386,表示你正在为i386基础的模拟器构建,因为它是一个Mac应用程序。

您必须为模拟器获取/添加i386库。

答案 2 :(得分:0)

看起来libcrypo不是为所有设备构建的,不确定从哪里获取库,检查以确保它们具有为al l设备构建的构建,如果您自己构建此lib,那么您需要为所有的建筑师制作构建,并确保将它们全部链接在一起