背景
在debian10 服务器上编译msoffice 加密二进制文件报错
github地址:
- 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