haskell/zlib

Cannot find foreign library (Ubuntu, with zlib1g-dev installed)

nuttycom opened this issue · 2 comments

I am attempting to build on Ubuntu but no matter how I try I can't seem to get zlib to find the native library. Both zlib1g and zlib1g-dev are installed.

nuttycom@dominion:~/oss/zlib (master)λ cabal new-build
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - zlib-0.6.2.2 (lib) (first run)
Configuring library for zlib-0.6.2.2..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
* Missing (or bad) C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

nuttycom@dominion:~/oss/zlib (master)λ sudo apt install zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu1).
Cmdv commented

I'm having the same issue on MacOs using nix, did you find a solution @nuttycom ?

I cannot reproduce, CI is green both for Ubuntu and MacOS.