問題描述
我正在嘗試在使用 OpenSSL 1.0.0 的 Ubuntu 10.04 LTS 上構(gòu)建一些代碼.當(dāng)我運(yùn)行 make 時(shí),它??會(huì)使用-lssl"選項(xiàng)調(diào)用 g++.來源包括:
I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0. When I run make, it invokes g++ with the "-lssl" option. The source includes:
#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 時(shí)遇到這些錯(cuò)誤:
But I guess the openssl package doesn't include the library. I get these errors on 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
如何在 Ubuntu 10.04 LTS 上安裝 OpenSSL C++ 庫?
How do I install the OpenSSL C++ library on Ubuntu 10.04 LTS?
我做了一個(gè) man g++
和(在鏈接選項(xiàng)"下)它聲明的 -l 選項(xiàng):鏈接器搜索庫的標(biāo)準(zhǔn)目錄列表......"和搜索的目錄包括幾個(gè)標(biāo)準(zhǔn)系統(tǒng)目錄……"那些標(biāo)準(zhǔn)系統(tǒng)目錄是什么?
I did a man g++
and (under "Options for Linking") for the -l option it states: " The linker searches a standard list of directories for the library..." and "The directories searched include several standard system directories..." What are those standard system directories?
推薦答案
你要安裝開發(fā)包,就是libssl-dev:
You want to install the development package, which is libssl-dev:
sudo apt-get install libssl-dev
這篇關(guān)于如何在 Ubuntu 上安裝 OpenSSL 庫?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!