Hide Forgot
Description of problem:When trying to extend xmonad by importing things inside its own library, it always fails with the same error: /usr/bin/ld: cannot find -lHSutf8-string-0.3.6-ghc7.0.2 collect2: ld returned 1 exit status Please check the file for errors. Version-Release number of selected component (if applicable): xmonad 0.9.2 How reproducible: (For me...) extremely easy Steps to Reproduce: 1. install xmonad as well as xmonad-devel & xmonad-contribs & contribd devel 2. cp the default xmonad.hs file into .xmonad/xmonad.hs 3. add a new import ( say XMonad.Hooks.DynamicLog) 4. save file and type "xmonad --recompile" 5. Profit Actual results: The error message above Expected results: No error messages Additional info: This was a brand new install of xmonad, no prior configuration.
What does "ghc-pkg list utf8-string" output?
[bryce@raidtest2 ~]$ ghc-pkg list utf8-string /usr/lib64/ghc-7.0.2/package.conf.d utf8-string-0.3.6 utf8-string-0.3.6 /home/bryce/.ghc/x86_64-linux-7.0.2/package.conf.d utf8-string-0.3.6 I made sure that they were installed before I said something. These errors come whenever I try to load a module in the xmonad.hs file. (Say import XMonad.Hook.DynamicLog). However, in ghci if I import Xmonad, I can import that library without issue.
> /usr/lib64/ghc-7.0.2/package.conf.d > utf8-string-0.3.6 > utf8-string-0.3.6 Hmm not sure why you have two system copies. > /home/bryce/.ghc/x86_64-linux-7.0.2/package.conf.d > utf8-string-0.3.6 If you unregister or remove this, it should solve your problem: it happens because Fedora's xmonad uses dynamic linking and I guess your user installed copy is static only. Unfortunately it is still easy to shoot oneself in the foot with cabal-install.
> it happens because Fedora's xmonad uses dynamic linking > and I guess your user installed copy is static only. I suppose we could perhaps add -no-user-package-conf to the xmonad patch to help prevent your problem: it would however prevent people from using a custom xmonad with the fedora xmonad package but maybe that is less of a problem.
Thank you for the help. I got it to work by doing two things. Unregistering utf8-string from cabal. Then deleting both references to utf8-string in /use/lib64/ghc-7.0.2/package.conf.d. And finally reinstalling utf8-string from yum. Thank you for the help.