1. The most usual reason for a linking error is that the file/library you need is not included in your target.
    1. First, if it’s a .m file, check if it is included in the target (choose the file and check it’s Target Membership panel – it’s also should be in Build Phases – Compile Sources).
    2. If it’s a library, also check it’s Target Membership, and it’s in Build Phases – Link Binary With Libraries).
    3. If it’s a framework, check Build Settings – Search Paths – Framework Search Paths 
    4. If it’s a pod, check Pods.debug/release.xcconfig, check for Header_Search_Paths and Library_Search_Paths.Header search path is where the compiler will look for header files (the “.h” files).Library search path is where the linker will look for compiled object files (or archive files containing those compiled object files) that are referenced from within the code being compiled and linked.
  2. ld: symbol(s) not found for architecture arm64 
    1. This library does not support 64-bit architecture. Xcode 5.1 and above  include arm64 as standard architecture. We can set $(ARCHS_STANDARD_32_BIT) instead in Build Settings – Architectures – Architectures 
    2. ld: symbol(s) not found for architecture i386 (it was resolved by adding Other Linker Flags to include the library)
      • -lBDPointSDK-${PLATFORM_NAME} -ObjC
  3. ld: library not found for -library

If this is the case, just click on the library (.a), uncheck the Target in Target Membership and recheck again, and it will be resolved.

Advertisements