我正在尝试在使用OpenSSL 1.0.0的Ubuntu10.04LTS上构建一些代码。当我运行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包中并没有包含这个库。我在make时得到以下错误:
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
如何在Ubuntu10.04LTS上安装OpenSSL C++库?
我创建了一个链接器(在“链接选项”下),对于-l选项,它说明:“链接器在标准目录列表中搜索库...”。和“搜索的目录包括几个标准系统目录...”这些标准系统目录是什么?
发布于 2010-06-11 01:43:32
您需要安装开发包libssl-dev:
sudo apt-get install libssl-dev
发布于 2010-06-11 01:44:21
运行:
apt-get install libssl-dev
发布于 2017-05-31 18:16:55
在Ubuntu上通过源代码安装openssl库的另一种方法是按照以下步骤安装,这里的WORKDIR
是您的工作目录:
sudo apt-get install pkg-config
cd WORKDIR
git clone https://github.com/openssl/openssl.git
cd openssl
./config
make
sudo make install
# Open file /etc/ld.so.conf, add a new line: "/usr/local/lib" at EOF
sudo ldconfig
https://stackoverflow.com/questions/3016956
复制相似问题