macos - ld : library not found for -lssl/clang: error: linker command failed with exit code 1 (use -v to see invocation)

标签 macos ssl linker-errors paho

我正在尝试在我的 macOS Moneterey12.3 上构建 Paho 客户端。
当我运行 make 命令时,出现以下错误
ld:警告:找不到选项“-L/usr/local/opt/openssl/lib”的目录
ld: 找不到 -lssl 的库
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
/usr/local/opt/openssl/lib 在我的设备上不存在。如何从编译中删除此选项?另外,我不确定如何解决 -lssl 问题。

最佳答案

如这里项目的自述文件中所述:
https://github.com/eclipse/paho.mqtt.c#build-requirements--compilation-using-cmake
使用 cmake 构建项目,而不是随附的 Makefile .

git clone https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c
mkdir build
cd build
cmake -DPAHO_WITH_SSL=FALSE ..
make

关于macos - ld : library not found for -lssl/clang: error: linker command failed with exit code 1 (use -v to see invocation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71510412/

相关文章:

linux - Mongorestore:createIndex 错误:v:2 索引键模式中的值不能是对象类型。只允许数字 > 0、数字 < 0 和字符串

haskell - 设置 SSL + Happstack 服务器示例失败并出现文件错误

c++ - 架构 x86_64 的 undefined symbol : "Shape::get_area()", 从 : votable for shape in shape. o 引用

C++ - 如何获取 C++ 可执行文件的当前目录?

linux - 如何从 bash 中的剪贴板获取值

html - 已安装 SSL 但仅在 index.html 上没有锁定

C++ 对默认构造函数的 undefined reference

ios - Apple Mach O 链接器错误

macos - 以编程方式快速设置 NSButton 的颜色

使用通配符子域的 Apache SSL 重写