我试图在Ubuntu 10.04 LTS上使用OpenSSL 1.0.0构建一些代码。当我运行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.
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选项它说:“链接器搜索标准目录列表的库…”和“搜索的目录包括几个标准系统目录.. 。“那些标准系统目录是什么?
更新:答案是sudo apt-get install libssl-dev。我怎么能想出来为自己(除了在这里提出这个问题)?我可以以某种方式告诉apt-get列出所有的包,和grep的ssl?或者我需要知道“lib * -dev”命名约定?
您想要安装开发包,这是libssl-dev:
原文链接:https://www.f2er.com/ubuntu/353063.htmlsudo apt-get install libssl-dev