danza danza - 3 months ago 9
Linux Question

Missing native library to build an Haskell package with Cabal, on Linux

i get an error when trying to build an Haskell package which depends on a native C library, even though the header file seems to be at its place. The error says:

Missing (or bad) header file


What is the meaning of this error? How can i find out more? The file is not missing since i can find it in my system, under
/usr/include/
. I tried to use the
--extra-include-dirs
option in order to point Cabal to the header file which is present in my system, but i still get the error. So the file is not missing, how can it be bad?

This is really a generic question about how to troubleshoot this kind of issues, but here are the details about my system:


  • Package to install:
    zlib

  • Missing header:
    zlib.h

  • Header position in my system:
    /usr/include/zlib.h

  • Operative system: Ubuntu 16.04



I installed any possible Ubuntu
zlib-dev
package i could find, including 32 bit versions

Answer

If you increase build verbosity with say -v3, you will get actual compiler error messages. In this case

/usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory

A quick googling of the name zlib.h reveals that this is a confirmed open Ubuntu bug.

Comments