XCode 4.2 链接器错误库未找到 -lFlurryAnalytics

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7885374/
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-09-14 22:13:37  来源:igfitidea点击:

XCode 4.2 linker error Library not found -lFlurryAnalytics

iosxcodeios5xcode4.2flurry

提问by odyth

enter image description here

在此处输入图片说明

I am getting this error when trying to build my project. I have a paid / free version the paid version is working just fine with the same library. However for some reason the free version is having a hard time with the Flurry Analytics library which is the same file version as the paid app. I added it by going to Add > Existing Frameworks... Add Other and browsed to the library in the paid apps folder. I am not sure what else to try I have made sure the project settings between paid and free version are identical, I have tried coping that file locally, I have googled and googled and am coming up short.

尝试构建我的项目时出现此错误。我有一个付费/免费版本,付费版本在同一个库中工作得很好。然而,由于某种原因,免费版本很难使用与付费应用程序相同的文件版本的 Flurry Analytics 库。我通过转到 Add > Existing Frameworks... Add Other 并浏览到付费应用程序文件夹中的库来添加它。我不知道还有什么可以尝试的 我已经确保付费版本和免费版本之间的项目设置是相同的,我已经尝试在本地处理该文件,我已经用谷歌搜索和谷歌搜索,但结果很差。

using Xcode 4.2 with iOS 5

在 iOS 5 中使用 Xcode 4.2

Thanks in advance.

提前致谢。

采纳答案by user2661518

Check if library is added in TARGETS -> Link Binary With Libraries. Mostly it will be there but wrong version. If you change the iOS version you should change binary as well. e.g. libz.1.dylib is in iOS7 link binary. But if you change to iOS9.1 you have to delete libz.1.dylib and add one from iOS9.1 libz.1.tbd

检查库是否已添加到 TARGETS -> Link Binary With Libraries。大多数情况下它会在那里,但版本错误。如果您更改 iOS 版本,您也应该更改二进制文件。例如 libz.1.dylib 在 iOS7 链接二进制文件中。但是如果你改成 iOS9.1 你必须删除 libz.1.dylib 并从 iOS9.1 libz.1.tbd 添加一个

回答by justin

it's likely not in the list of ld's search paths. either qualify the path or add its parent to the list of directories for ld to search.

它可能不在 ld 的搜索路径列表中。要么限定路径,要么将其父项添加到 ld 搜索的目录列表中。

回答by Alan

We just had a project fail to build after upgrading to Xcode 4.2. In our case the error was:

升级到 Xcode 4.2 后,我们刚刚有一个项目无法构建。在我们的例子中,错误是:

ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1

It turns out that this particular SDK library changed versions, and the file we were pointing to is no longer included in the latest distribution.

事实证明,这个特定的 SDK 库更改了版本,我们指向的文件不再包含在最新的发行版中。

To fix it, I clicked on the libz.1.2.3.dylib entry in the Xcode Project Navigator pane. (It was highlighted in a red font because its path was incorrect.) Next, in the Xcode Utilities pane, in the File Inspector tab, I clicked on the "Choose File" icon beneath the Location listbox which is set to "Relative to SDK". I navigated to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/ and found that libz.1.2.3.dylib didn't exist, so I chose the latest version libz.1.2.5.dylib.

为了修复它,我单击了 Xcode Project Navigator 窗格中的 libz.1.2.3.dylib 条目。(它以红色字体突出显示,因为它的路径不正确。)接下来,在 Xcode Utilities 窗格中的 File Inspector 选项卡中,我单击了设置为“Relative to SDK”的 Location 列表框下方的“Choose File”图标”。我导航到/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/,发现libz.1.2.3.dylib不存在,所以我选择了最新版本的libz.1.2 .5.dylib。