xcode “ld:警告:找不到选项的目录”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9458739/
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
‘ld: warning: directory not found for option’
提问by Frenck
When I'm building my Xcode 4 apps I'm getting this warning:
当我构建我的 Xcode 4 应用程序时,我收到此警告:
ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../../../Downloads/Google Analytics SDK/Library'
ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../Google Analytics SDK/Library'
But I do not have Google Analytics in my app, I deleted all of it how can I remove the error? And archiving an app gives me the error:
但是我的应用程序中没有 Google Analytics,我删除了所有内容,如何消除错误?归档应用程序给了我错误:
clang: error: no such file or directory: 'armv6'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I've tried so many things but I'm still getting this error when I'm trying to make an .IPA file
我已经尝试了很多东西,但是当我尝试制作 .IPA 文件时仍然出现此错误
回答by Blazer
You need to do this:
你需要这样做:
- Click on your project (targets)
- Click on Build Settings
- if your error includes the
-L
flag, then delete the values in Library Search?Paths - if your error includes the
-F
flag, then delete the values in Framework Search?Paths
- if your error includes the
- 单击您的项目(目标)
- 点击构建设置
- 如果您的错误包括该
-L
标志,则删除Library Search?Paths 中的值 - 如果您的错误包含该
-F
标志,则删除Framework Search?Paths 中的值
- 如果您的错误包括该
And regarding the second error, sorry i can't help you out with that one. Hope someone else can help you out.
关于第二个错误,抱歉我不能帮你解决那个错误。希望其他人可以帮助您。
回答by Marc
There are two errors that people seem to be confusing.
有两个错误让人们似乎很困惑。
If it is a "directory not found for option '-L/..." error, that means it's a Library Error, and you should try to:
如果它是“找不到选项 ' -L/... 的目录”错误,则意味着这是一个库错误,您应该尝试:
- Click on your project (targets)
- Click on Build Settings
- Under Library Search Paths, delete the paths
- 单击您的项目(目标)
- 点击构建设置
- 在Library Search Paths 下,删除路径
If it is a "directory not found for option '-F/...", that means it's a Framework Error, and you should try to:
如果它是“找不到选项 ' -F/... 的目录”,则意味着它是框架错误,您应该尝试:
- Click on your project (targets)
- Click on Build Settings
- Under Framework Search Paths, delete the paths
- 单击您的项目(目标)
- 点击构建设置
- 在Framework Search Paths 下,删除路径
This might happen when you move the referenced file around.
当您四处移动引用的文件时,可能会发生这种情况。
回答by lujop
My problem was that I opened the original .xcodeprojinstead of the .xcworkspacethat was generated by CocoaPods.
我的问题是我打开了原来的.xcodeproj而不是CocoaPods生成的 .xcworkspace。
回答by backslash-f
回答by Lazar Kukolj
I use cocoa podsso for me, I quit Xcode and ran
我使用可可豆荚,所以对我来说,我退出 Xcode 并运行
pod install
again and reopened the project. This fixed everything!
再次并重新打开该项目。这解决了一切!
回答by Iron Mike
For me the problem was a missing escape "\" character.
对我来说,问题是缺少转义“\”字符。
My search paths were broken up on several lines in the Library Search Paths. Conveniently, they were breaking at spaces in my path. Adding the escape "\" fixed it for me.
我的搜索路径在 Library Search Paths 中被分成几行。方便的是,它们在我路径上的空隙处断裂。添加转义符“\”为我修复了它。
$(PROJECT_DIR)/My\ Project\ Name/My\ Directory
回答by Jasper
I found the reference which I had to remove at:
我在以下位置找到了必须删除的参考:
- Target
- Build Settings
- Header Search Paths
- 目标
- 构建设置
- 标题搜索路径
回答by Sam B
In my case the problem was Framework Search paths that had incomplete, dead, old links or multiple frameworks of same type. Remove them and your project will compile without any problem.
就我而言,问题是框架搜索路径具有不完整、死链接、旧链接或多个相同类型的框架。删除它们,您的项目将毫无问题地编译。
be sure to do Build -> clean
一定要做 Build -> clean
回答by Francesco
I ran into the same problem (the first one) after an Xcode crash and none of the solutions proposed worked. To suppress the warning I have done:
我在 Xcode 崩溃后遇到了同样的问题(第一个),并且提出的解决方案都没有奏效。为了抑制我所做的警告:
? manage schemes...
? 管理计划...
? deleted the current scheme
? 删除了当前方案
? Autocrate Schemes Now
? 立即独裁计划
回答by Major MacGregor
This is what worked for me:
这对我有用:
- Click on Project
- Click on Build Settings
- Search for "Framework Search Paths"
- Clear the path and type "$(inherited)"
- 点击项目
- 点击构建设置
- 搜索“框架搜索路径”
- 清除路径并输入“$(inherited)”