首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法编译xmonad.hs文件

无法编译xmonad.hs文件
EN

Stack Overflow用户
提问于 2018-05-01 23:22:06
回答 2查看 2.5K关注 0票数 4

我在一个基于arch的系统上使用xmonad。但在升级后,我无法通过以下方式编译我的xmonad.hs文件

$ xmonad --recompile

我似乎在xmonad的每个模块上都得到了错误,甚至导入XMonad似乎都不起作用。如果有人以某种方式解决了这个问题,请让我知道。

错误消息:

代码语言:javascript
复制
Error detected while loading xmonad configuration file: 
/home/arya/.xmonad/xmonad.hs

xmonad.hs:2:1: error:
    Could not find module ‘XMonad’
    Use -v to see a list of the files searched for.
  |
2 | import XMonad
  | ^^^^^^^^^^^^^

xmonad.hs:3:1: error:
    Could not find module ‘XMonad.Config.Mate’
    Use -v to see a list of the files searched for.
  |
3 | import XMonad.Config.Mate
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:5:1: error:
    Could not find module ‘XMonad.StackSet’
    Use -v to see a list of the files searched for.
  |
5 | import qualified XMonad.StackSet as W
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:8:1: error:
    Could not find module ‘XMonad.Hooks.ManageDocks’
    Use -v to see a list of the files searched for.
  |
8 | import XMonad.Hooks.ManageDocks
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:9:1: error:
    Could not find module ‘XMonad.Hooks.EwmhDesktops’
    Use -v to see a list of the files searched for.
  |
9 | import XMonad.Hooks.EwmhDesktops
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:10:1: error:
    Could not find module ‘XMonad.Layout.Minimize’
    Use -v to see a list of the files searched for.
   |
10 | import XMonad.Layout.Minimize
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please check the file for errors.

[arya@localhost ~]$ Warning: Missing charsets in String to FontSet 
conversion
[arya@localhost ~]$ 
monad.hs:9:1: error:
    Could not find module ‘XMonad.Hooks.EwmhDesktops’
    Use -v to see a list of the files searched for.
  |
9 | import XMonad.Hooks.EwmhDesktops
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

xmonad.hs:10:1: error:
    Could not find module ‘XMonad.Layout.Minimize’
    Use -v to see a list of the files searched for.
   |
10 | import XMonad.Layout.Minimize
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

输出:

$ type -a ghc

代码语言:javascript
复制
ghc is /usr/local/bin/ghc
ghc is /usr/bin/ghc

$ ghc-pkg list的输出:

代码语言:javascript
复制
 /usr/local/haskell/ghc-8.2.2-x86_64/lib/ghc-8.2.2/package.conf.d
    Cabal-2.0.1.0
    array-0.5.2.0
    base-4.10.1.0
    binary-0.8.5.1
    bytestring-0.10.8.2
    containers-0.5.10.2
    deepseq-1.4.3.0
    directory-1.3.0.2
    filepath-1.4.1.2
    (ghc-8.2.2)
    ghc-boot-8.2.2
    ghc-boot-th-8.2.2
    ghc-compact-0.1.0.0
    ghc-prim-0.5.1.1
    ghci-8.2.2
    haskeline-0.7.4.0
    hoopl-3.10.2.2
    hpc-0.6.0.3
    integer-gmp-1.0.1.0
    pretty-1.1.3.3
    process-1.6.1.0
    rts-1.0
    template-haskell-2.12.0.0
    terminfo-0.4.1.0
    time-1.8.0.2
    transformers-0.5.2.0
    unix-2.7.2.2
    xhtml-3000.2.2

pacman -Ql xmonad的输出:

代码语言:javascript
复制
xmonad /usr/
xmonad /usr/bin/
xmonad /usr/bin/xmonad
xmonad /usr/lib/
xmonad /usr/lib/ghc-8.2.2/
xmonad /usr/lib/ghc-8.2.2/site-local/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/Paths_xmonad.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Config.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Core.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Layout.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Main.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/ManageHook.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/Operations.dyn_hi
xmonad /usr/lib/ghc-8.2.2/site-local/xmonad-0.13/XMonad/StackSet.dyn_hi
xmonad /usr/lib/libHSxmonad-0.13-K842KXy8eLK2djQHd55ZyZ-ghc8.2.2.so
xmonad /usr/share/
xmonad /usr/share/doc/
xmonad /usr/share/doc/xmonad/
xmonad /usr/share/doc/xmonad/LICENSE
xmonad /usr/share/haskell/
xmonad /usr/share/haskell/register/
xmonad /usr/share/haskell/register/xmonad.sh
xmonad /usr/share/haskell/unregister/
xmonad /usr/share/haskell/unregister/xmonad.sh
xmonad /usr/share/licenses/
xmonad /usr/share/licenses/xmonad/
xmonad /usr/share/licenses/xmonad/LICENSE
xmonad /usr/share/man/
xmonad /usr/share/man/man1/
xmonad /usr/share/man/man1/xmonad.1.gz
xmonad /usr/share/pixmaps/
xmonad /usr/share/pixmaps/xmonad.svg
xmonad /usr/share/xmonad/
xmonad /usr/share/xmonad/man/
xmonad /usr/share/xmonad/man/xmonad.1
xmonad /usr/share/xmonad/man/xmonad.1.html
xmonad /usr/share/xmonad/man/xmonad.hs
xmonad /usr/share/xsessions/
xmonad /usr/share/xsessions/xmonad.desktop
EN

回答 2

Stack Overflow用户

发布于 2021-02-24 06:00:07

略有关联,

在全新安装XmonadUbuntu20.10时,当我使用sudo apt install xmonad通过apt安装时,我遇到了这个问题。我想这也安装了xmonad-contrib,它位于这里的libghc-xmonad-contrib-dev,因为当我尝试安装它时,我已经安装了它,看看它是否修复了。最终解决这个问题的是cabal-使用cabal install xmonad安装xmonad和xmonad-contrib,然后使用cabal install --lib xmonad-contrib,同时在~/.xmonad/build中创建一个构建命令。

~/.xmonad/build的内容

代码语言:javascript
复制
ghc -package xmonad -package xmonad-contrib --make xmonad.hs -i -ilib -main-is main -fforce-recomp -o xmonad

以下是我的命令历史记录,如果它有任何帮助的话:

代码语言:javascript
复制
 1912  ghc-pkg list # to check the output, just as in the question
 1913  cabal install xmonad
 1914  xmonad --recompile
 1915  cabal install xmonad-contrib
 1916  cabal install --lib xmonad-contrib # the previous line gave a warning, so I issued a corrected command.
 1917  xmonad --recompile
 1918  ghc -package xmonad ~/.xmonad/monad.hs
 1919  ghc -package xmonad ~/.xmonad/xmonad.hs # the previous line had a typo, so I had to issue the command again.
 1920  xmonad --recompile
 1921  nano .xmonad/build # when I tried the previous command, it said something about creating the following file, so I created it.
 1922  xmonad --recompile
 1923  chmod u+x .xmonad/build # when I tried the previous command, it complained about the file not being executable and recommended those permissions.
 1924  xmonad --recompile # worked!!!
票数 2
EN

Stack Overflow用户

发布于 2018-05-06 22:12:33

可能是Arch linux上的XMonad包有一些问题。

作为替代方案,您可以尝试使用pacman -s haskell-cabalcabal install xmonad

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50119141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档