[Haskell-cafe] build problem (X11 under cabal)

Don Stewart dons at galois.com
Sat Sep 29 15:10:39 EDT 2007

>    Not being very savvy in building things I got stuck when trying to build
>    xmonad. It needs X11 1.2.2, so I tried to build that. Configuration step
>    went fine (I believe), but buiding failed:
>    > runhaskell Setup.hs build
>    Preprocessing library X11-1.2.2...
>    /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld:
>    cannot find -lX11
>    collect2: ld returned 1 exit status
>    linking Graphics/X11/Types_hsc_make.o failed
>    command was: /usr/bin/ghc-6.6 -lX11 Graphics/X11/Types_hsc_make.o -o
>    Graphics/X11/Types_hsc_make
>    Setup.hs: got error code while preprocessing: Graphics.X11.Types
>    I have tried the ghc command seperately with the flag -L/usr/X11R6/lib
>    which makes it compile. But I cannot figure out how to proceed from here.

this is such a common issue for xmonad, we have a faq about it:


the trick is that you'll need to add something like:

    extra-lib-dirs: /usr/X11R6/lib/

to your .cabal file.

-- Don

More information about the Haskell-Cafe mailing list