I've been trying to compile a Haskell project which depends on Pango (via Gtk3), so far without success. The issue seems to be with the preprocessor (based on odd mangled type names), but I have yet to find the exact cause.
I'm using stack
on a 64-bit machine running Windows 10 and GHC 7.10. I've compiled other projects using Gtk3 with cabal
- on the same PC - so I'm fairly certain it's not a compatibility issue.
I've included a small portion of the build log below.
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist\setup-wrapper\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist\setup-wrapper\Main.o )
Linking dist/setup-wrapper\setup.exe ...
Configuring pango-0.13.1.0...
Building pango-0.13.1.0...
Preprocessing library pango-0.13.1.0...
[ 1 of 14] Compiling Graphics.Rendering.Pango.Types ( .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\Types.hs, .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\Types.o )
[ 2 of 14] Compiling Graphics.Rendering.Pango.BasicTypes ( .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\BasicTypes.hs, .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\BasicTypes.o )
[ 3 of 14] Compiling Graphics.Rendering.Pango.Structs ( .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\Structs.hs, .stack-work\dist\i386-windows\Cabal-1.22.4.0\build\Graphics\Rendering\Pango\Structs.o )
GraphicsRenderingPangoStructs.hsc:79:21:
Not in scope: type constructor or class ÔÇÿWord420906795024ÔÇÖ
GraphicsRenderingPangoStructs.hsc:79:40:
Not in scope: type constructor or class ÔÇÿWord420906795024ÔÇÖ
GraphicsRenderingPangoStructs.hsc:79:59:
Not in scope: type constructor or class ÔÇÿWord420906795024ÔÇÖ
It continues with a whole slew of nearly identical errors.
EDIT (cf. haoformayor's comment)
I encountered that error ticket before posting this question, but wasn't sure how to fix the printf
issue 'cleanly'. I have tried following your advice, but I transitioned from cabal quite recently and am still not familiar with the basics of stack
.
Having edited my stack.yaml file (see below), I was met with the very same list of error messages.
packages:
- location:
git: https://github.com/gtk2hs/gtk2hs.git
commit: dff5deae25a3f2c7d63ae583d1096b626bb6a9d2
I'll include additional information if necessary. Perhaps I've done something wrong?
EDIT
I've amended the git
URL and removed a duplicated packages
key in my stack.yaml
file. Stack
is now able to find the latest version of gtk2hs
on GitHub, but complains about a missing .cabal
file. Presumably I have to run it through some alternative build system (eg. gtk2hs-buildtools
).