c++ - 如何在 Ubuntu 上安装 OpenSSL 库?

标签 c++ ubuntu installation openssl

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

相关文章:

linux - 在 Linux Mint 上为 Java EE 开发人员安装 eclipse IDE

reactjs - 如何安装节点sass?

c++ - 有人可以帮我弄清楚我在这里做错了什么吗?

c++ - 当左值分配给右值引用时会发生什么?没有破坏临时对象?

c++ - 随机内存访问很昂贵?

ubuntu - 如何修复右键单击触摸板在 Ubuntu 18.0 上不起作用的问题

C++ 结构列表 push_back 的问题

MySQL 查询缓存效率

c - Pthreads 程序有时会产生错误的输出和正确的输出

python - 用 Anaconda 安装了一个包,无法在 Python 中导入