xcode 找不到 -lXXX 的库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6967196/
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
Library not found for -lXXX
提问by Zugdud
If your trying to run an iphone project downloaded from the internet in Xcode and you encounter "Library not found for -lxxx", where -xxx is some third party library where would you look to set the library path? I am not sure where this is setup, in the SCM->library path is blank and everything else seems to match the configuration window for other working projects
如果您尝试在 Xcode 中运行从 Internet 下载的 iphone 项目,并且遇到“未找到 -lxxx 的库”,其中 -xxx 是某个第三方库,您将在哪里设置库路径?我不确定这是在哪里设置的,在 SCM->library 路径是空白的,其他一切似乎都与其他工作项目的配置窗口相匹配
When I look at the build log i see the following in the linker output:
当我查看构建日志时,我在链接器输出中看到以下内容:
-ObjC -ljson
-objC -ljson
How can i configure the project to not try to link in that library at build time?
如何将项目配置为在构建时不尝试链接该库?
回答by Nate Hat
if using cocoapods
and getting this error, try updating the cococapods
$ sudo gem update cocoapods
Then update the pod for the project$ pod update
I don't know the exact reason but I think it was because the old version didn't set the libraries properly for the new XCode
.
Hope this helps.
如果使用cocoapods
并收到此错误,请尝试更新cococapods
$ sudo gem update cocoapods
然后更新项目的 pod$ pod update
我不知道确切原因,但我认为这是因为旧版本没有为新版本正确设置库XCode
。
希望这可以帮助。
回答by Zugdud
Within the build tab of project settings there is a field for linker options, I removed the -ljson from here to solve the issue.
在项目设置的构建选项卡中有一个链接器选项字段,我从这里删除了 -ljson 以解决问题。
回答by Praveen-K
回答by prak253
This might be helpful in some cases:
在某些情况下,这可能会有所帮助:
Xcode > Preferences > Locations > Locations > Advanced, select Unique.
I was facing a similar issue and chaging to "unique" from "legacy" solved the problem
我遇到了类似的问题,从“遗留”改成“独特”解决了这个问题