库找不到.....?

时间:2013-10-08 10:24:35

标签: c++ iphone ios xcode

我添加了新框架(第三方)并构建。

不幸的是,因为执行不是。

我该如何解决这个问题? 整整四个晚上都花了。:(

Ld /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos/iBaseballManager.app/iBaseballManager normal armv7s
    cd /DevLibs/BaseballManager_KOR/iBaseballManager
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos -L/DevLibs/BaseballManager_KOR/iBaseballManager/Classes/BaseballManager/kakaoUtil/kakao-ios-sdk -F/Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos -filelist /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Intermediates/iBaseballManager.build/Distribution-iphoneos/iBaseballManager_Device.build/Objects-normal/armv7s/iBaseballManager.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=6.0 -framework StoreKit -framework SystemConfiguration -framework CoreData -weak_framework AdSupport -framework MediaPlayer -framework CoreTelephony -framework Security -lzlib -lstdc++ -lCxImage -lj2k -ljasper -lkakao-ios-sdk-i386-armv7-armv7s -ljbig -ljpeg -lpng -ltiff -framework AudioToolbox -framework AVFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenAL -framework OpenGLES -framework QuartzCore -liClet -Xlinker -dependency_info -Xlinker /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Intermediates/iBaseballManager.build/Distribution-iphoneos/iBaseballManager_Device.build/Objects-normal/armv7s/iBaseballManager_dependency_info.dat -o /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos/iBaseballManager.app/iBaseballManager

ld:找不到-lzlib的库 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

11 个答案:

答案 0 :(得分:28)

删除对库的引用并再次添加,它将解决问题。

答案 1 :(得分:19)

使用xcworkspace它可以解决您的问题。

一旦我安装了可可豆荚,我也面临同样的困境;关闭并再次使用xcworkspace启动将解决您的问题。

答案 2 :(得分:16)

确保您已在“构建设置”中的“库搜索路径”中为库添加了必要的搜索路径。

应该有类似的东西:

${SOURCE_ROOT}/Framework/Classes

对于.a文件,您需要在Build Phase中设置Target Dependencies。 只需单击“+”并在那里添加.a文件。

答案 3 :(得分:12)

有同样的问题,这些答案都没有为我解决。

问题是工作区中的Pod项目具有以下配置:

Build Active Architecture Only: YES

出于这个原因,当我想为i386(模拟器)构建时,XCode没有构建Pods项目,因此无法满足依赖性。一旦我将其更改为NO,它就开始工作了

答案 4 :(得分:6)

如果有人在这里专门寻找未找到-lPods""错误,这是通过打开工作区而不是xcodeproject来解决的。搜索google找不到没有引号的-lPods的库会将此SO帖子作为第一个结果,而如果您将搜索包装在引号中,您将获得一个包含我刚刚给出的答案的帖子。

答案 5 :(得分:5)

我将-all_load更改为-force_load

答案 6 :(得分:2)

在Xcode goto中选择你的项目

构建设置 - >搜索路径 - >库搜索路径使用 / usr / local / lib

设置路径

注意:确保在框架中添加了dylib

答案 7 :(得分:0)

我的情况:使用cocoapods,打开xcworkspace,并找到未找到-lPods-AFNetworking"的库。错误。

我的解决方案:偏好 - >位置 - >派生数据,点击"高级"按钮 - >选择共享文件夹'。 (遇到错误时,原始位置为Legacy)。

答案 8 :(得分:0)

OS X 10.11 Xcode7.0.1

我的情况:

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

我删除所有与pod相关的内容,添加“$(inherited)”然后修复它。

Other Linker Flags image

答案 9 :(得分:0)

上述解决方案都不适合我,所以我下载了丢失的库:

https://github.com/danielctull-forks/GoogleAnalytics-SDK-iOS

答案 10 :(得分:0)

7.3.1 Pods 1.0.0

今天有同样的东西,在cocoapods从0.39.0更新到1.0.0之后。

发生错误:“ld:找不到库-lPods”。

我意外地连接了两个“Pod”库。一个是lPods,另一个是lPods-ProjectName。我删除了“libPods.a:from Project> General> Linked Frameworks and Libraries

和!当然,我将Pods> Build Active Build Architecture改为NO。

它有效。

相关问题