how to solve: ld: library not found for -lXYZ

Xcode链接错误解决方案
本文主要介绍了当使用Xcode进行项目构建时遇到ld: library not found for -lXYZ这类链接错误时的解决方法。通常这类问题出现在尝试链接一个系统未找到的静态库时。文章详细解释了如何检查并修正项目文件中Framework组内的路径设置,以及如何在项目的构建阶段和设置中正确地添加或重新添加丢失的库。

Xcode 链接的时候报错 形式如 ld: library not found for -lXYZ,其中XYZ时静态库的名字

解决方法:删除后再重新添加。

如果提示framework 找不到,也可以先删除后再重新添加。


It means you are trying to link to a library which is not found by the system. In your case that appears to be a simple static library. You should check the following:

  • Look for the corresponding item in red among your project files, with special attention to the Frameworks group (that's where people normally put libraries). If you find one, fix the path or just remove and re-add the library manually.
  • Repeat this in the Link Binary with Libraries entry under the Build Phases tab in the project/target settings.
  • Check the Library Search Paths entry in the Build Settings tab in project/target settings. Make sure the path to your libXYZ.a file is listed there.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值