How can I fix the "inappropriate type of result in an external declaration: CULong" to create gtk2hs errors?

When I try to compile the Haskell gtk package with ghc-7.6.1, I get the following error (when trying to create 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 this happens during the upgrade.

How can I fix the error?

+4
source share
1 answer

This problem occurs if you have older versions of gtk2hs-buildtools installed that do not work with newer versions of ghc. The solution is to upgrade the gtk2hs-buildtools package before continuing with the upgrade:

 sudo cabal install --reinstall gtk2hs-buildtools 
+5
source

Source: https://habr.com/ru/post/1469119/


All Articles