开发者

cannot open source file "openssl/bn.h"

#include <openssl/dh.h>
#include <openssl/开发者_Go百科bn.h>

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


  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


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


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.


You either are missing that file or haven't set your include paths right.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜