我正在尝试在使用 OpenSSL 1.0.0 的 Ubuntu 10.04 LTS 上构建一些代码。当我运行 make 时,它使用“-lssl”选项调用 g++。来源包括:
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/des.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
我跑了:
$ sudo apt-get install openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
但我猜 openssl 包不包含该库。我在制作时收到这些错误:
foo.cpp:21:25: error: openssl/bio.h: No such file or directory
foo.cpp:22:28: error: openssl/buffer.h: No such file or directory
foo.cpp:23:25: error: openssl/des.h: No such file or directory
foo.cpp:24:25: error: openssl/evp.h: No such file or directory
foo.cpp:25:25: error: openssl/pem.h: No such file or directory
foo.cpp:26:25: error: openssl/rsa.h: No such file or directory
如何在 Ubuntu 10.04 LTS 上安装 OpenSSL C++ 库?
我做了一个 man g++
并且(在“链接选项”下)对于 -l 选项它指出:“链接器搜索库的标准目录列表……”和“搜索的目录包括几个标准系统目录…” 那些标准系统目录是什么?
原文由 Daryl Spitzer 发布,翻译遵循 CC BY-SA 4.0 许可协议
您要安装开发包,即 libssl-dev: