安装 Git时发现这样子一个问题

 安装 Git时发现这样子一个问题

[root@localhost git-1.6.6]# make
    CC fast-import.o
In file included from builtin.h:6,
                 from fast-import.c:147:
cache.h:17:18: error: zlib.h: No such file or directory
In file included from builtin.h:6,
                 from fast-import.c:147:
cache.h:22: error: expected ‘)’ before ‘strm’
cache.h:23: error: expected ‘)’ before ‘strm’
cache.h:24: error: expected ‘)’ before ‘strm’
fast-import.c:284: error: ‘Z_DEFAULT_COMPRESSION’ undeclared here (not in a function)
fast-import.c: In function ‘store_object’:
fast-import.c:1040: error: ‘z_stream’ undeclared (first use in this function)
fast-import.c:1040: error: (Each undeclared identifier is reported only once
fast-import.c:1040: error: for each function it appears in.)
fast-import.c:1040: error: expected ‘;’ before ‘s’
fast-import.c:1076: error: ‘s’ undeclared (first use in this function)
fast-import.c:1087: error: ‘Z_FINISH’ undeclared (first use in this function)
fast-import.c:1087: error: ‘Z_OK’ undeclared (first use in this function)
fast-import.c: In function ‘git_pack_config’:
fast-import.c:2470: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function)
make: *** [fast-import.o] Error 1

然后使用这样子的命令:
 yum install zlib-devel -y 可以解决这个小问题

还要提醒:使用make 之前必须要确保那个压缩文件必须存在。否则会一直提示错误,然后安装不成功

你可能感兴趣的:(linux)