我正在尝试在使用 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++
并且(在“Options for Linking”下)它声明的 -l 选项:“The linker searches a standard list of directories for the library...”和“搜索到的目录包括几个标准的系统目录……”那些标准的系统目录是什么?
最佳答案
您要安装开发包,即 libssl-dev:
sudo apt-get install libssl-dev
关于c++ - 如何在 Ubuntu 上安装 OpenSSL 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41989998/