You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Fedora 42下用Stack安装yesod-bin遇zlib依赖错误求助

安装Yesod框架时zlib依赖编译失败问题

我尝试按照推荐步骤安装Yesod框架:

stack new my-project yesodweb/sqlite
cd my-project
stack install yesod-bin --install-ghc

但执行后出现编译错误:

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package zlib-0.6.3.0 (scroll up to its section to see the error) using:....

其中关于zlib构建的具体错误提示如下:

zlib               > Cabal-simple_w2MFVN35_3.6.3.0_ghc-9.2.8: Missing dependency on a foreign
zlib               > library:
zlib               > * Missing (or bad) header file: zlib.h
zlib               > * Missing (or bad) C library: z
zlib               > This problem can usually be solved by installing the system package that
zlib               > provides this library (you may need the "-dev" version). If the library is
zlib               > already installed but in a non-standard location then you can use the flags
zlib               > --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
zlib               > library file does exist, it may contain errors that are caught by the C
zlib               > compiler at the preprocessing stage. In this case you can re-run configure
zlib               > with the verbosity flag -v3 to see the error messages.
zlib               > If the header file does exist, it may contain errors that are caught by the C
zlib               > compiler at the preprocessing stage. In this case you can re-run configure
zlib               > with the verbosity flag -v3 to see the error messages.

我使用Fedora 42系统,已通过zlib-ng安装了zlib及其开发版本:

❯ dnf list --installed | grep zlib
zlib-ng.x86_64                                       2.2.4-3.fc42                         fedora
zlib-ng-compat.i686                                  2.2.4-3.fc42                         fedora
zlib-ng-compat.x86_64                                2.2.4-3.fc42                         fedora
zlib-ng-compat-devel.x86_64                          2.2.4-3.fc42                         fedora
zlib-ng-devel.x86_64                                 2.2.4-3.fc42                         fedora

且zlib.h文件确实存在于/usr/include目录中,我不确定问题所在,也不知道如何进一步调试。

内容的提问来源于stack exchange,提问作者dec

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 15:42:43