简体   繁体   中英

Add .a dependency when you are using pod

I have a project that has a pod dependency 'GoogleMap'. now I want to use ZbarSDK too.

ZBarSDK has two .a file that I add them to 'LinkBinaryWithLibraries' section of my project and also add the library headers too. but I still receive below error when want to run the app:

    Ld /Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Products/Debug-iphoneos/APMB.app/APMB normal armv7
    cd "/Users/rad/Documents/GIT Repo/iOS-APMB"
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Products/Debug-iphoneos -F/Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Products/Debug-iphoneos -F/Users/rad/Documents/GIT\ Repo/iOS-APMB/Pods/GoogleMaps/Frameworks -filelist /Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Intermediates/APMB.build/Debug-iphoneos/APMB.build/Objects-normal/armv7/APMB.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=7.0 -dead_strip -Xlinker -no_deduplicate -fembed-bitcode-marker -ObjC -lc++ -licucore -lz -framework AVFoundation -framework Accelerate -framework CoreBluetooth -framework CoreData -framework CoreGraphics -framework CoreLocation -framework CoreText -framework GLKit -framework GoogleMaps -framework ImageIO -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -force_load -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a -Xlinker -add_ast_path -Xlinker /Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Intermediates/APMB.build/Debug-iphoneos/APMB.build/Objects-normal/armv7/APMB.swiftmodule -lPods -lzbar -lzbar-sim -Xlinker -dependency_info -Xlinker /Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Intermediates/APMB.build/Debug-iphoneos/APMB.build/Objects-normal/armv7/APMB_dependency_info.dat -o /Users/rad/Library/Developer/Xcode/DerivedData/APMB-fbbvbbebzyjbwgaaoqaanlaiftor/Build/Products/Debug-iphoneos/APMB.app/APMB

ld: library not found for -lzbar
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does someone knows what is the problem?

Try checking your HEADER_SEARCH_PATH and LIBRARY_SEARCH_PATH build settings. Those tell the linker where to search for the .a files, and .h files for your #import / #include statements. You may need to enter the paths to the necessary files.

If you open the popup window for either setting, you should be able to drag the directory containing the .a or .h files, respectively, from Finder into the Xcode popover, and it will figure out the relative path for you using something like ${SRCROOT} .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM