haskell - 使用 Stack 安装 X11 软件包时出现 "X11 libraries not found"错误

标签 haskell x11 haskell-stack

我需要使用x11 packagelts-8.2 resolver ,当我运行命令 stack build 时,我得到以下信息:

X11-1.8: configure
Progress: 1/2
--  While building package X11-1.8 using:
/tmp/stack7885/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0    /setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 configure --with-ghc=/home/userXYZ/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --with-ghc-pkg=/home/userXYZ/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb --libdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/lib --bindir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/bin --datadir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/share --libexecdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/libexec --sysconfdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/etc --docdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --htmldir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --haddockdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --dependency=base=base-4.9.1.0 --dependency=data-default=data-default-0.7.1.1-7EGYJX2YWqWJRbPFUHNoCr

Process exited with code: ExitFailure 1
Logs have been written to: /home/userXYZ/Documents/programming/haskell/projects/MyStack/screen-linux/.stack-work/logs/X11-1.8.log

[1 of 1] Compiling Main             ( /tmp/stack7885/X11-1.8/Setup.hs, /tmp/stack7885/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )

/tmp/stack7885/X11-1.8/Setup.hs:6:29: warning: [-Wdeprecations]
    In the use of ‘defaultUserHooks’
    (imported from Distribution.Simple):
    Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
             compatibility in which case you must stick with defaultUserHooks"
Linking /tmp/stack7885/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup ...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.8...
configure: WARNING: unrecognized options: --with-hc
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for X... no
configure: error: in `/tmp/stack7885/X11-1.8':
configure: error: X11 libraries not found, so X11 package cannot be built
See `config.log' for more details

我在 LinuxMint 17.2 64 位上运行。

我发现了类似的问题here ,但不幸的是这并没有帮助我解决我的问题。

我正在寻求任何帮助来解决该问题。我不完全确定从哪里开始。

=================================

编辑:按照 duplode 的建议,我加载了 libx11-dev,然后在运行 stack build 后收到以下一组其他消息:

    X11-1.8: configure
Progress: 1/2
--  While building package X11-1.8 using:
    /tmp/stack12282/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 configure --with-ghc=/home/userXYZ/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --with-ghc-pkg=/home/userXYZ/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb --libdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/lib --bindir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/bin --datadir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/share --libexecdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/libexec --sysconfdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/etc --docdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --htmldir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --haddockdir=/home/userXYZ/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/doc/X11-1.8 --dependency=base=base-4.9.1.0 --dependency=data-default=data-default-0.7.1.1-7EGYJX2YWqWJRbPFUHNoCr
Process exited with code: ExitFailure 1
Logs have been written to: /home/userXYZ/Documents/programming/haskell/projects/MyStack/screen-linux/.stack-work/logs/X11-1.8.log

[1 of 1] Compiling Main             ( /tmp/stack12282/X11-1.8/Setup.hs, /tmp/stack12282/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )

/tmp/stack12282/X11-1.8/Setup.hs:6:29: warning: [-Wdeprecations]
    In the use of ‘defaultUserHooks’
    (imported from Distribution.Simple):
    Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
             compatibility in which case you must stick with defaultUserHooks"
Linking /tmp/stack12282/X11-1.8/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup ...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.8...
configure: WARNING: unrecognized options: --with-hc
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... no
checking whether to build Xinerama... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking X11/extensions/Xinerama.h usability... no
checking X11/extensions/Xinerama.h presence... no
checking for X11/extensions/Xinerama.h... no
WARNING: Xinerama headers not found. Building without Xinerama support
checking X11/extensions/Xrandr.h usability... no
checking X11/extensions/Xrandr.h presence... no
checking for X11/extensions/Xrandr.h... no
configure: error: X11/extensions/Xrandr.h (from libXrandr) is required

最佳答案

使用 stack 或 cabal-install 安装软件包时缺少库的错误通常与必须单独安装的非 Haskell 依赖项有关,因为 Haskell 特定的工具并不是要自己拉他们。在这种情况下,引用 the readme X11 Haskell 包...

You will need development versions of at least the X11, xrandr, and Xinerama libraries installed for the build to succeed [...]

这些库的开发版本可以通过 Linux 发行版的包管理器安装;对于 Mint,它们相当于 libx11-dev , libxrandr-devlibxinerama-dev分别封装。

关于haskell - 使用 Stack 安装 X11 软件包时出现 "X11 libraries not found"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42455814/

相关文章:

list - 序列语法糖([1..6])如何转换为实际的列表语法(1 :2:3. ..6)?

haskell - main=return()是一个程序吗?

linux - 包括X服务器的压力测试

c - 如何优雅地退出 X11 事件循环?

x11 - 在 X11 根窗口中检测修改键释放

Haskell 堆栈在构建时忽略 -Wall -Werror cabal ghc-options 标志

docker - 使用 docker : true 时获取堆栈以获取 GHCJS 内置 docker 图像

arrays - 数组上不确定函数的异步映射

haskell - 在没有浏览器的情况下使用 Stack?列出解析器、搜索等。

haskell - 在 lambda 演算中找到解决方案后,将其转换为代码有多容易?