项目场景:
在做项目时需要在centos7中安装redis,但是执行make && make test && make install
之后出现错误。
In file included from adlist.c:34:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
50 | #include <jemalloc/jemalloc.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/software/Redis/redis-6.2.7/src'
make: *** [all] Error 2
问题描述
后来经过查找,最后使用命令make MALLOC=libc
解决这个问题。
但是呢,有出现了新的错误:
release.c:37:10: fatal error: release.h: No such file or directory
37 | #include "release.h"
| ^~~~~~~~~~~
compilation terminated.
make[1]: *** [release.o] Error 1
make[1]: Leaving directory `/usr/local/software/Redis/redis-6.2.7/src'
make: *** [all] Error 2
再经过查找资料,最终通过以下命令解决了这个问题:
在redis-6.2.7/src文件夹下的执行命令chmod +x mkreleasehdr.sh
再回到redis-6.2.7文件夹下执行命令make
解决问题
执行完成,不再报错。