简体   繁体   English

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

[英]Apple Mach-O Linker Warning Directory not found

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? 我应该怎么做才能得到这些警告?

You have to follow these step: 你必须遵循以下步骤:

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

Good Luck !! 祝好运 !!

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 answer for more info. 有关详细信息,请参阅此答案

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 "ABC". 假设您的目录名称为“ABC”。 If you use $(SRCROOT) you might get something like: 如果你使用$(SRCROOT)你可能得到类似的东西:

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

还要检查构建设置 - >框架搜索路径以查找未使用的文件夹(当我今天从项目中删除Carthage时发生了这种警告)

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

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