C++ 图书馆没有找到.....?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19245133/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:39:17  来源:igfitidea点击:

library not found for.....?

c++iphoneiosxcode

提问by realmasse

i added new framework(3rd party) and build.

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

Unfortunately, since the execution was not.

不幸的是,由于没有执行。

How do I solve this problem? The whole four nights were spent.:(

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

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: library not found for -lzlib clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

采纳答案by realmasse

I changed -all_loadto -force_load

我改-all_load-force_load

回答by Muhammad Aamir Ali

Remove the reference to the library and add it again, it will solve the problem.

删除对库的引用并重新添加,它会解决问题。

回答by AppleBee

Use xcworkspaceit will solve your problem.

使用xcworkspace它将解决您的问题。

I also faced same once I install cocoa pods; Close and launch with xcworkspaceagain will solve your problem.

安装可可豆荚后,我也面临同样的问题;关闭并xcworkspace再次启动将解决您的问题。

回答by Grzegorz Krukowski

Make sure you have added the necessary search path for your library in Library Search Paths in Build Settings.

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

There should be something like:

应该有类似的东西:

${SOURCE_ROOT}/Framework/Classes

For .a files you need to set Target Dependencies in Build Phases in section. Just click "+" and add your .a file there.

对于 .a 文件,您需要在部分的构建阶段中设置目标依赖项。只需单击“+”并在那里添加您的 .a 文件。

回答by Roozbeh Zabihollahi

Had the same problem and none of these answers fix it for me.

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

Problem was Pod project in workspace had the following config:

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

Build Active Architecture Only: YES

For that reason, when I wanted to build for i386 (Simulator), XCode did not build Pods projects, so it could not meet dependencies. As soon as I changed it to NOit started working

为此,当我想为 i386(模拟器)构建时,XCode 没有构建 Pods 项目,因此无法满足依赖项。我一改成NO它就开始工作了

回答by Mike

If anyone is here looking specifically for the "library not found for -lPods" error, this was solved by opening the workspace instead of the xcodeproject. Searching google for library not found for -lPods without quotes turns this SO post as the first result, whereas if you wrap the search in quotes you'll get a post with the answer I just gave.

如果有人在这里专门寻找“未找到 -lPods 的库”错误,则可以通过打开工作区而不是 xcodeproject 来解决此问题。在没有引号的情况下搜索 google for library not found for -lPods 会将这个 SO 帖子作为第一个结果,而如果您将搜索括在引号中,您将得到一个包含我刚刚给出的答案的帖子。

回答by Shanmuka

In Xcode goto select your project

在 Xcode 中选择你的项目

Build Settings -> Search Paths -> Library Search Paths set the path with /usr/local/lib

Build Settings -> Search Paths -> Library Search Paths 用/usr/local/lib设置路径

note : make sure that you have added dylib at frameworks

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

回答by u5391889

OS X 10.11 Xcode7.0.1

OS X 10.11 Xcode7.0.1

my case:

我的情况:

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

I delete all pod related content, add "$(inherited)" then fix it.

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

Other Linker Flags image

其他链接器标志图像

回答by MB_iOSDeveloper

None of the above solutions worked for me, so I downloaded the missing library:

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

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

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

回答by Artem Katlenok

7.3.1 Pods 1.0.0

7.3.1 豆荚 1.0.0

Had same stuff today, after cocoapods update from 0.39.0 to 1.0.0.

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

Had an error : "ld: library not found -lPods".

出现错误:“ld:未找到库 -lPods”。

I've got linked two "Pod" libs, accidentally. One was lPods, and other was lPods-ProjectName. I deleted "libPods.a: from Project>General>Linked Frameworks and Libraries

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

AND! I changed Pods>Build Active Build Architecture to NO, of course.

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

And it worked.

它奏效了。