我正在尝试在我的 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/