错误“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 -
或者另一个建议是, 请使用 cocoa 足类。这对依赖性有好处。
这里是完整的教程。
因为不使用 cocoapods 你需要做更多的配置,比如你需要设置 headerpath 等等,这是一项非常繁琐的工作。
在您的项目中安装 cocoapod 后,您需要从 .xcworkspace 打开它,而不是从 .xcodeproj 文件打开它。检查编辑后的图像。
关于c++ - 代码错误 "ld: library not found for -lmysqlclient ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35451285/