致命错误:openssl / ssl.h:没有这样的文件或目录

时间:2018-04-22 11:33:28

标签: c++ openssl

我来自Python,是C ++的新手,我正在尝试测试一个通过websockets检索数据的程序。

我用

复制了this github repository
  git clone https://github.com/tensaix2j/binacpp

我正在尝试运行这个例子,所以我填写了api密钥和秘密:

 /binacpp/example/example.cpp

现在来自/ binacpp / example文件夹我正在尝试

make example

我收到了这个错误:

Making example


g++ -I../lib/libcurl-7.56.0/include -I../lib/jsoncpp-1.8.3/include -I../lib/libwebsockets-2.4.0/include -I../lib/libbinacpp/include \
example.cpp \
-L../lib/libcurl-7.56.0/lib \
-L../lib/libwebsockets-2.4.0/lib \
-L../lib/libbinacpp/lib \
-lcurl -ljsoncpp  -lcrypto -lwebsockets -lbinacpp -o example
In file included from ../lib/libbinacpp/include/binacpp_websocket.h:16:0,
                 from example.cpp:8:
../lib/libwebsockets-2.4.0/include/libwebsockets.h:214:10: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
Makefile:25: recipe for target 'example' failed
make: *** [example] Error 1

user@ip:/opt/binacpp/example$ ^C
user@ip:/opt/binacpp/example$ ./example.run.sh
./example: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory

我想弄清楚为什么我会收到这个错误以及如何处理它?<​​/ p>

1)它在自述文件中说依赖性是

  jsoncpp-1.8.3
  libcurl-7.56.0
  libwebsockets-2.4.0

但是这些都包含在存储库中

2)如果假设openssl通常已安装,我怎么知道要安装哪个版本?我如何安装它,因为使用Python你可以使用pip,所有内容都将放在正确的目录中,以便将它包含在你的程序中。

1 个答案:

答案 0 :(得分:2)

看起来没有安装openssl的开发包:

https://stackoverflow.com/a/3016986/5147260