make process cannot find include files


Some software that i need to use depends on zlib. I looked in package manager and it said zlib1g was installed so I tried to make the software but got this error

make[1]: Entering directory `/home/andrea/samtools/samtools-0.1.6'
gcc -c -g -Wall -O2  -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -D_CURSES_LIB=1  bgzf.c -o bgzf.o
In file included from bgzf.c:36:
bgzf.h:30: fatal error: zlib.h: No such file or directory
compilation terminated.
make[1]: *** [bgzf.o] Error 1
make[1]: Leaving directory `/home/andrea/samtools/samtools-0.1.6'
make: *** [all-recur] Error 1

I tried installing zlib manually as I wasn't sure if the zlib1g in synaptic was the correct package so i installed zlib following the instructions here to /usr/local/zlib

I tried re-making but got the same error

zlib.h does seem to be on the system

locate zlib.h

I don't know much about make or where it looks for included files. How do i tell make where to look? In the Makefile for the software there is a line called INCLUDES= but this is empty/not set.

I'm nervous about fiddling around with these files. What happens to the system if a make process fails.

Who is Participating?
It is complaining about C header file.  I have been making packages myself but not for Ubuntu, for Red Hat.  Header files are typically included in the devel package (develpment).
What type of Linux do you have?  Do you have rpms and yum?

Mostly the head files are included in the devel package.  So you can try getting zlib-devel.

Of course this all depends upon the type of Linux you are using.
andiejeAuthor Commented:
I'm using ubuntu 10.10. I installed zlib1g-dev and it worked
How did you know:

zlib1g was the equivalent package for zlib?
how did you know i needed the development package as well?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.