user788585
user788585

Reputation: 151

Linker command failed with exit code 1 (user -v to see invocation) (iOS 9)

I have been googling the above error for four days and can't find a solution that works for my project. This is my error log if any one has any ideas please respond. I am trying to make my project run. I am upgrading from Xcode 6 to Xcode 7 to 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)

Upvotes: 1

Views: 681

Answers (3)

Charles A.
Charles A.

Reputation: 11123

You have a some libraries linked against your application that do not have an i386 architecture slice in them. These are the libraries it is complaining about:

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

You either need to include versions of these libraries that include machine code for all the architectures of your target (simulator is i386 or x86-64, iOS device is going to be some arm instruction set like arm7vs or arm64), or you need to restrict your target's architectures to match what is available in your dependent libraries.

Upvotes: 2

zaph
zaph

Reputation: 112855

There are three linker warnings, 15+ Undefined symbols for architecture 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

The final error which is fairly self explanatory:

ld: symbol(s) not found for architecture i386

These are i386 which indicates you are building for the simulator which is i386 bases since it is a Mac app.

You must get/add i386 libraries for the simulator.

Upvotes: 1

Knight0fDragon
Knight0fDragon

Reputation: 16837

Looks like libcrypo is not built for all devices, not sure where you are getting your library from, check to make sure that they have a build that is built for al l device, if you are building this lib yourself, then you need to make builds for all the architicectuers and sure you link them all together

Upvotes: 0

Related Questions