c++ - 代码错误 "ld: library not found for -lmysqlclient "

标签 c++ ios objective-c xcode sqlite

错误“ld:找不到 -lmysqlclient 的库” clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

我在我的项目中添加了一个 C++ 文件。该文件包含一些库,列表如下:

"Sqlite3.h"
<sqlite3.h>
<iostream>
<sstream>
<set>
<utility>
<stdio.h>
<stdlib.h>
<string.h>
<map>
<list>
<math.h>
<algorithm>

有什么问题吗?我是否必须更改 Xcode 中的某些设置?

最佳答案

首先是你的错误:

please check the Library Search Paths. There are instances when you copy or duplicate a target, Xcode decides that it needs to escape any double quotes " with a '\'. Make sure you remove all the \’s - it should look like this -

enter image description here

或者另一个建议是, 请使用 cocoa 足类。这对依赖性有好处。

这里是完整的教程。

Install cocoapods

因为不使用 cocoapods 你需要做更多的配置,比如你需要设置 headerpath 等等,这是一项非常繁琐的工作。

在您的项目中安装 cocoapod 后,您需要从 .xcworkspace 打开它,而不是从 .xcodeproj 文件打开它。检查编辑后的图像。

enter image description here

关于c++ - 代码错误 "ld: library not found for -lmysqlclient ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35451285/

相关文章:

ios - FBFriendPickerViewController 以编程方式选择好友

ios - 在 Firebase 中创建用户后立即发送验证邮件

objective-c - ios fileExistsAtPath 新文件失败

c++ - 如何在 C++ 中获得一个月的第三个星期五?

c++ - 这个程序调用带有参数包的函数指针有什么问题?

ios - 检查特定的手势识别器

ios - 如何在屏幕底部创建一个UIDatePicker并收集数据?

iphone - 组合图像制作 UIButton?

c++ - 如何知道 libstdc++ 是否支持 std::regex

c++ - 快速 GDB 问题;如果多个内存位置显示为,这意味着什么?