ios 未找到 Apple Mach-O 链接器警告目录

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

Apple Mach-O Linker Warning Directory not found

iphoneiosobjective-cxcode

提问by donkey

I have spent my last five hours looking for this weird situation a reasonable explanation.

在过去的五个小时里,我一直在寻找这种奇怪情况的合理解释。

Here is the warning:

这是警告:

ld: warning: directory not found for option '-L/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0/Extend/SDKExport'
ld: warning: directory not found for option '-F/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0/Connection'
ld: warning: directory not found for option '-F/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0/Core'
ld: warning: directory not found for option '-F/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0/Extend'
ld: warning: directory not found for option '-F/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0'
ld: warning: directory not found for option '-F/Users/oasis_weng/Desktop/My Life/Life For Myself/Programming/Projects/ChangWeiBo/../xCodeExamples/ShareSDK/ShareSDK_v2.1.0/UI'

However though, I know all those alleged "missing files" are truly and actually existed in my application folder and the app runs properly with these files.

但是,我知道所有所谓的“ missing files”确实存在于我的应用程序文件夹中,并且应用程序可以使用这些文件正常运行。

The problem of those directories in the warning is the actual path do not include the ../xCodeExamples/ part.

警告中那些目录的问题是实际路径不包括 ../xCodeExamples/ part.

What should I do to get these warning away?

我该怎么做才能消除这些警告?

回答by Ajay Chaudhary

You have to follow these step:

您必须按照以下步骤操作:

  • Click on your project (targets)
  • Click on Build Settings
  • Under "Library Search Paths", delete the paths
  • Clean your build and run again.
  • 单击您的项目(目标)
  • 点击构建设置
  • 在“图书馆搜索路径”下,删除路径
  • 清理您的构建并再次运行。

Good Luck !!

祝你好运 !!

回答by Senseful

For me, the bad path was under Framework Search Paths.

对我来说,糟糕的路径是在框架搜索路径下。

The easiest way to find where the bad path is, is to type a part of it in the search box on the top right. That will filter the list to only that one bad path. Deleting it, as the other answer suggests, fixes the problem.

找到坏路径的最简单方法是在右上角的搜索框中输入它的一部分。这会将列表过滤为仅该一条错误路径。正如另一个答案所暗示的那样,删除它可以解决问题。

See this answerfor more info.

有关更多信息,请参阅此答案

回答by Rok Jarc

Had the same problem today with different solution (might help someone).

今天遇到了同样的问题,但有不同的解决方案(可能对某人有帮助)。

If your source directory name $(SRCROOT)include spaces, use "$(SRCROOT)"instead of $(SRCROOT)in Library Search Paths.

如果您的源目录名称$(SRCROOT)包含空格,请使用 "$(SRCROOT)"而不是$(SRCROOT)在库搜索路径中。

Let's say your directory name is "A B C". If you use $(SRCROOT)you might get something like:

假设您的目录名称是“AB C”。如果你使用$(SRCROOT)你可能会得到类似的东西:

directory not found for option '-LA'
directory not found for option '-LB'
directory not found for option '-LC'

回答by Robert Juz

Also check Build Settings->Framework Search Path for unused folders (this kind of warning happened to me when I deleted Carthage from the project today)

还要检查 Build Settings->Framework Search Path 以查找未使用的文件夹(我今天从项目中删除 Carthage 时发生了这种警告)