make process cannot find include files

Posted on 2011-05-01
Last Modified: 2012-05-11

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.

Question by:andieje
    LVL 31

    Expert Comment

    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.

    Author Comment

    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?
    LVL 31

    Accepted Solution

    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).

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now