0

This error came from cabal build all when Building and installing the node on wsl2 windows 10

logged error:

Failed to build digest-0.0.1.3. The failure occurred during the configure
step.
Build log (
/home/wims/.cabal/logs/ghc-8.10.7/digest-0.0.1.3-a20fd23134cb7f40320b9ca3d928b4eb5bd682be662c87ea00d19556ef64fdcb.log
):
Configuring library for digest-0.0.1.3..
cabal-3.6.2.0: 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.

cabal: Failed to build digest-0.0.1.3 (which is required by
test:tx-generator-test from tx-generator-2.2, exe:tx-generator from
tx-generator-2.2 and others). See the build log above for details.
1

1 Answer 1

2

The cause of the problem is right there in the error message

cabal-3.6.2.0: Missing dependency on a foreign library:
 * Missing (or bad) header file: zlib.h
 * Missing (or bad) C library: z

I have not used WSL on Windows but I suspect the solution is similar to the solution on Debian, namely sudo apt install zlib1g zlib1g-dev.

3
  • Yes this is linux on windows and when I ran sudo apt install zlib1g zlib1g-dev, it did not work Aug 15, 2022 at 17:50
  • So what happened when you ran that command? Aug 15, 2022 at 21:14
  • Sorry for late reply, I have no answer to this. Now I am using Docker Desktop and i do not face that problem. I think there are some lines I was skipping by mistake as all these documentations are not numbered and some installations take time Aug 17, 2022 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.