简体   繁体   English

使用Pod时添加.a依赖项

[英]Add .a dependency when you are using pod

I have a project that has a pod dependency 'GoogleMap'. 我有一个具有pod依赖项“ GoogleMap”的项目。 now I want to use ZbarSDK too. 现在我也想使用ZbarSDK。

ZBarSDK has two .a file that I add them to 'LinkBinaryWithLibraries' section of my project and also add the library headers too. ZBarSDK有两个.a文件,我将它们添加到项目的“ LinkBinaryWithLibraries”部分,并且还添加了库头。 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. 尝试检查您的HEADER_SEARCH_PATHLIBRARY_SEARCH_PATH构建设置。 Those tell the linker where to search for the .a files, and .h files for your #import / #include statements. 那些告诉链接到哪里搜索.a文件,和.h文件为您#import / #include语句。 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} . 如果您打开任一设置的弹出窗口,则应该能够将包含.a或.h文件的目录分别从Finder拖到Xcode弹出窗口中,它将使用${SRCROOT}类的内容为您找到相对路径。 ${SRCROOT}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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