4
votes

When trying to compile the gtk Haskell package with ghc-7.6.1, I get the following error (when trying to build pango, one of the dependencies, but it also occurs in other dependency packages if I try to install them manually):

[ 1 of 14] Compiling Graphics.Rendering.Pango.Types ( dist/build/Graphics/Rendering/Pango/Types.hs, dist/build/Graphics/Rendering/Pango/Types.o )

Graphics/Rendering/Pango/Types.chs:249:1:
    Unacceptable result type in foreign declaration: CULong
    When checking declaration:
      foreign import ccall unsafe "static pango_context_get_type" pango_context_get_type
        :: CULong

I previously installed an older version of gtk2hs, and so this occurs during an upgrade.

How can I fix the error?

1
I am not having a problem with ghc-7.6. The relevant tools seem to be hsc2hs, which comes with ghc, and gtk2hsC2hs which comes with gtk2hs buildtools, as a1kmm says. Maybe these are out of date. - applicative

1 Answers

5
votes

This problem occurs if you have old versions of the gtk2hs-buildtools installed, which don't work with newer versions of ghc. The solution is to update your gtk2hs-buildtools package before continuing with the update:

sudo cabal install --reinstall gtk2hs-buildtools