Home  >  Article  >  Backend Development  >  How to Install OpenSSL Libraries on Ubuntu for C Development: Why You Need the libssl-dev Package?

How to Install OpenSSL Libraries on Ubuntu for C Development: Why You Need the libssl-dev Package?

DDD
DDDOriginal
2024-10-25 10:45:02861browse

How to Install OpenSSL Libraries on Ubuntu for C   Development: Why You Need the libssl-dev Package?

Installing OpenSSL Libraries on Ubuntu for C Development

Attempting to build code utilizing OpenSSL 1.0.0 on Ubuntu 10.04 LTS, users may encounter errors indicating missing OpenSSL header files. Despite having the openssl package installed, the necessary library is not available.

To resolve this issue, the development package, libssl-dev, is required. It contains the headers and libraries needed for C development:

sudo apt-get install libssl-dev

This package includes the following headers:

  • openssl/bio.h
  • openssl/buffer.h
  • openssl/des.h
  • openssl/evp.h
  • openssl/pem.h
  • openssl/rsa.h

The linker typically searches the following standard system directories for libraries:

  • /lib
  • /usr/lib
  • /usr/local/lib
  • /usr/lib64 (on 64-bit systems)

By installing the libssl-dev package, the necessary headers and libraries will be made available, allowing compilation and linking of code that utilizes OpenSSL.

The above is the detailed content of How to Install OpenSSL Libraries on Ubuntu for C Development: Why You Need the libssl-dev Package?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn