dtrace4linux / linux

dtrace for linux - kernel driver and userland tools
http://crtags.blogspot.com
1.16k stars 223 forks source link

fatal error: zlib.h: No such file or directory #81

Open akshah123 opened 10 years ago

akshah123 commented 10 years ago

I am getting fatal error: zlib.h: No such file or directory on make all step.

Here is the a bit more detailed output

BUILD_DIR=build-3.5.0-46-generic tools/build.pl build-3.5.0-46-generic `uname -m`
tools/check_dep.pl
tools/mkport.pl
/usr/bin/ld: cannot find -ldw
collect2: error: ld returned 1 exit status
tools/libgcc.pl
tools/mksyscall.pl
Processing (32): /lib/modules/3.5.0-46-generic/build/arch/x86/include/generated/asm/unistd_32.h
Creating: build-3.5.0-46-generic/driver/syscalls-x86.tbl - 346 entries
Processing (64): /lib/modules/3.5.0-46-generic/build/arch/x86/include/generated/asm/unistd_64.h
Creating: build-3.5.0-46-generic/driver/syscalls-x86-64.tbl - 313 entries
make all0
cd tests ; make --no-print-directory
case `uname -m` in \
          x86_64) \
                cc -m64 -g -o ../build-3.5.0-46-generic/sys64 syscalls.c ; \
                cc -m32 -g -o ../build-3.5.0-46-generic/sys32 syscalls.c || true ; \
                ;; \
          i686) \
                cc -m32 -g -o ../build-3.5.0-46-generic/sys32 syscalls.c ; \
                ;; \
          arm*) \
                cc -g -o ../build-3.5.0-46-generic/sys32 syscalls.c ; \
                ;; \
        esac
cd libctf ; make --no-print-directory
gcc -g  -I../common -I../common/ctf -I../uts/common/ -I../common/ctf -I. -I../linux -DCTF_OLD_VERSIONS  -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -c uncompress.c
uncompress.c:9:20: fatal error: zlib.h: No such file or directory
compilation terminated.
make[2]: *** [../build-3.5.0-46-generic/libctf.a(uncompress.o)] Error 1
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1
akshah123 commented 10 years ago

Also, here is the output from running dependency step before this. I should also mention I am using ubuntu 12.10

Reading package lists... Done
Building dependency tree       
Reading state information... Done
bison is already the newest version.
flex is already the newest version.
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libelf-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libc6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
E: Unable to locate package libiberty-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++-multilib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
cneira commented 10 years ago

In debian wheezy package zlib1g-dev provides zlib.h

dtrace4linux commented 10 years ago

dtrace assumes you have all the relevant files to build a kernel or normal development packages. Theres a bunch of deps scripts in the tools/ dir, but they are designed as starting points. I dont attempt to determine exactly the distro release and ensure all dependencies are present, as that is not really feasible - given the number of distros and versions of distros.

On 28 June 2014 17:24, Carlos Neira notifications@github.com wrote:

In debian wheezy package zlib1g-dev provides zlib.h

— Reply to this email directly or view it on GitHub https://github.com/dtrace4linux/linux/issues/81#issuecomment-47431809.

thekakester commented 8 years ago

Sorry to re-awaken an old post, but I have this problem and I can't get anything to work. I installed zlib1g-dev, and zlib.h exists under /usr/include/zlib.h yet it is not recognized when building. Do you have any ideas on what I could do next? I've been looking on the internet for the past 3-4 hours and I'm deciding it might be time to start asking questions

dtrace4linux commented 8 years ago

i would

$ strace -o logfile -f ....

the build and then grep for zlib and see where it is looking. It could be the wrong compiler installed or a 32b vs 64b issue. It shouldnt happen (not for zlib.h)

On 7 July 2016 at 21:52, thekakester notifications@github.com wrote:

Sorry to re-awaken an old post, but I have this problem and I can't get anything to work. I installed zlib1g-dev, and zlib.h exists under /usr/include/zlib.h yet it is not recognized when building. Do you have any ideas on what I could do next? I've been looking on the internet for the past 3-4 hours and I'm deciding it might be time to start asking questions

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dtrace4linux/linux/issues/81#issuecomment-231203608, or mute the thread https://github.com/notifications/unsubscribe/ABWFhL33-pzUSR6VomyVk4JKdQNYMxvKks5qTWbxgaJpZM4Bv6LK .

Uleandrosp commented 7 years ago

@cneira

In debian wheezy package zlib1g-dev provides zlib.h

Yes, I had a problem with my Kali, and after install apt-get install zlib1g-dev, works good.

juangelzl commented 6 years ago

for fedora, i used zlib-devel, worked fine