Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install the OpenSSL libraries on Ubuntu?

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>

I ran:

$ 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.

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

How do I install the OpenSSL C++ library on Ubuntu 10.04 LTS?

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?

like image 240
Daryl Spitzer Avatar asked Sep 26 '22 19:09

Daryl Spitzer


People also ask

How do I install OpenSSL library?

Compile the openssl and development libraries with the make command. Install the compiled openssl binaries and development libraries with the “make install” command. Navigate to the OpenSSL installation directory and execute openssl command in order to check its version.

Where is OpenSSL library Linux?

If you have a 64-bit Linux distribution and you are running VA Smalltalk 32-bit, you will need to specifically request that the OpenSSL 32-bit libraries be installed. on Fedora 22 32-bit, they are located in /usr/lib, on Ubuntu 15.04 64-bit, the 32-bit OpenSSL libraries are located in /lib/i386-linux-gnu.

Where is OpenSSL folder Ubuntu?

By default, the OpenSSL directory is /usr/local/ssl . If you perform a config without --prefix and without --openssldir , that's what you get by default. Headers will be located in /usr/local/ssl/include/openssl and libraries will be located in /usr/local/ssl/lib .


1 Answers

You want to install the development package, which is libssl-dev:

sudo apt-get install libssl-dev
like image 692
Niki Yoshiuchi Avatar answered Oct 13 '22 00:10

Niki Yoshiuchi