Abanoub
Abanoub

Reputation: 3809

cannot open source file "openssl/bn.h"

#include <openssl/dh.h>
#include <openssl/bn.h>

Errors:cannot open source file "openssl/bn.h",cannot open source file "openssl/dh.h" ??? whats wrong

Upvotes: 4

Views: 18255

Answers (3)

Erik Nellessen
Erik Nellessen

Reputation: 412

The problem is, that your compiler can not find the header file bn.h. The reason for this might be, that there is something wrong with your include path.

It might also be, that you did not install the header files. Depending on your system, you need to install a package which is called something like libssl-dev. This package contains the header files. The package libssl contains only the shared object files (ending with .so), these are needed for the linking process, not for the compiling process. If installing libssl-dev solves your problem and you run into a linker problem afterwards, you should also install libssl.

Upvotes: 1

Kos
Kos

Reputation: 364

You, probably, missing the include paths. If you are using Visual Studio, you should go to Tools->Options->Projects and Solutions->C++ Directories and select from dropdown list option "include files" and add a path to openssl include folder. Either you can just copy openssl folder into your sources folder and change to "openssl/bn.h".

Upvotes: 2

Vivek Goel
Vivek Goel

Reputation: 24160

  1. Make sure you have libssl installed on system. If you are on linux use command

    $yum list libssl

  2. If it is installed. Make sure you had given it's path in include directory. If you are using gcc you can tell gcc to search in directory by using

    -I /path_of_libssl folder

Upvotes: 3

Related Questions