【发布时间】:2011-03-02 07:28:03
【问题描述】:
我正在尝试在使用 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++ 库?
我为 -l 选项做了一个man g++ 和(在“链接选项”下)它指出:“链接器搜索库的标准目录列表......”和“搜索的目录包括几个标准系统目录..." 那些标准的系统目录是什么?
【问题讨论】:
-
不完全重复,但由What are *-devel packages?回答。
-
您对
-dev命名约定是正确的。您还可以使用synaptic包管理器列出名称包含 libssl 的所有包 - 浏览该列表及其描述可能会给您提供线索。 -
我知道这个问题现在已经死了,但自从我最近发现它后,我认为其他人也可能会这样做。如果要列出与某个名称相似的所有包,我喜欢使用 >aptitude search
运行搜索不需要 root 权限级别。 -
只是为了补充 Evan 的声明,最新版本的 Ubuntu 即将推出,但没有可用的 aptitude 命令。 apt-cache search
现在(几乎)以相同的方式工作。 -
回答你的更新,你可以
apt-cache search package-name
标签: c++ ubuntu installation openssl