使用Stack安装X11软件包时出现“找不到X11库”错误

时间:2017-02-25 12:02:52

标签: 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 64bits上运行。

我发现了一个类似的问题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

1 个答案:

答案 0 :(得分:3)

使用 stack cabal-install 安装软件包时缺少库的错误通常是关于必须单独安装的非Haskell依赖项,因为Haskell特定的工具不是& #39;意思是自己拉它们。在这种情况下,引用 X11 Haskell包的the readme ...

  

您需要至少为构建安装的X11,xrandr和Xinerama库的开发版本才能成功[...]

可以通过Linux发行版的软件包管理器安装这些库的开发版本;在Mint的情况下,它们分别相当于libx11-devlibxrandr-devlibxinerama-dev包。