相关文章推荐
绅士的闹钟  ·  Android音视频【二】 ...·  2 年前    · 
踏实的风衣  ·  网络相关面试题 - 知乎·  2 年前    · 
  • https://github.com/herumi/msoffice
root@e0fef8daa858:/var/www/msoffice# make -j RELEASE=1
/usr/bin/make -C src
make[1]: Entering directory '/var/www/msoffice/src'
g++ -c msoffice-crypt.cpp -o release/msoffice-crypt.o -g -D_FILE_OFFSET_BITS=64 -msse2 -fno-operator-names -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -Ofast -fomit-frame-pointer -DNDEBUG -march=native -msse4 -I/var/www/msoffice/include -I/var/www/msoffice/../cybozulib/include -I/var/www/msoffice/../mie/include
g++ -c attack.cpp -o release/attack.o -g -D_FILE_OFFSET_BITS=64 -msse2 -fno-operator-names -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -Ofast -fomit-frame-pointer -DNDEBUG -march=native -msse4 -I/var/www/msoffice/include -I/var/www/msoffice/../cybozulib/include -I/var/www/msoffice/../mie/include
In file included from /var/www/msoffice/include/decode.hpp:14,
                 from msoffice-crypt.cpp:16:
/var/www/msoffice/../cybozulib/include/cybozu/crypto.hpp:30:10: fatal error: openssl/hmac.h: No such file or directory
   30 | #include <openssl/hmac.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [../common.mk:57: release/msoffice-crypt.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /var/www/msoffice/include/attack.hpp:14,
                 from attack.cpp:14:
/var/www/msoffice/../cybozulib/include/cybozu/crypto.hpp:30:10: fatal error: openssl/hmac.h: No such file or directory
   30 | #include <openssl/hmac.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [../common.mk:57: release/attack.o] Error 1
make[1]: Leaving directory '/var/www/msoffice/src'
make: *** [Makefile:7: all] Error 2
  • 要解决这个问题,你需要安装 OpenSSL 开发包,执行以下命令进行安装,然后重新编译即可解决
apt update && apt install libssl-dev
  • 如果是centos的话,可以执行下面命令解决
yum install openssl-dev -y
在docker镜像(centos系统)中,编译代码时,有如下错误
fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>                   // SSL_*
找不到 openssl/ssl.h 头文件是因为 openssl-devel 缺失导致的,安装该库即可,可用如下命令:
[root@JasonSong haproxy-1.9.4]# make clean
[root@JasonSong haproxy-1.9.4]# make -j 8 TARGET=linux2628 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1
  CC      src/e...