miércoles 21 de julio de 2010

[SOLVED] Git compilation error form sourcecode : 'Z_BEST_COMPRESSION' undeclared

When compiling git fron the source code the following errors appears


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:285: error: 'Z_DEFAULT_COMPRESSION' undeclared here (not in a function)
fast-import.c: In function 'store_object':
fast-import.c:996: error: 'z_stream' undeclared (first use in this function)
fast-import.c:996: error: (Each undeclared identifier is reported only once
fast-import.c:996: error: for each function it appears in.)
fast-import.c:996: error: expected ';' before 's'
fast-import.c:1028: error: 's' undeclared (first use in this function)
fast-import.c:1039: error: 'Z_FINISH' undeclared (first use in this function)
fast-import.c:1039: error: 'Z_OK' undeclared (first use in this function)
fast-import.c: In function 'stream_blob':
fast-import.c:1142: error: 'z_stream' undeclared (first use in this function)
fast-import.c:1142: error: expected ';' before 's'
fast-import.c:1143: error: 'Z_OK' undeclared (first use in this function)
fast-import.c:1165: error: 's' undeclared (first use in this function)
fast-import.c:1175: error: 'Z_STREAM_END' undeclared (first use in this function)
fast-import.c:1188: error: 'Z_FINISH' undeclared (first use in this function)
fast-import.c:1200: error: 'Z_BUF_ERROR' undeclared (first use in this function)
fast-import.c: In function 'git_pack_config':
fast-import.c:2846: error: 'Z_BEST_COMPRESSION' undeclared (first use in this function)



To solve this :


sudo apt-get install zlib1g-dev
Google Analytics Alternative