Ticket #1211 (new defect)

Opened 4 years ago

Last modified 3 years ago

cairo demo in ghci throws "unknown symbol" error

Reported by: guest Owned by: paolo
Priority: blocker Milestone:
Component: Cairo bindings Version:
Keywords: unknown symbol, cairo_image_surface_get_data Cc: d.kahlenberg@…

Description

I successully installed gtk2hs-0.12.0, but when trying to run the demo app (cairo package) Drawing.hs, I get

Prelude> :load Drawing.hs
[1 of 1] Compiling Main             ( Drawing.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
Loading package transformers-0.2.2.0 ... linking ... done.
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package array-0.3.0.2 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package bytestring-0.9.1.10 ... linking ... done.
Loading package Win32-2.2.0.1 ... linking ... done.
Loading package filepath-1.2.0.0 ... linking ... done.
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package old-time-1.0.0.6 ... linking ... done.
Loading package directory-1.1.0.0 ... linking ... done.
Loading package process-1.0.1.5 ... linking ... done.
Loading package time-1.2.0.3 ... linking ... done.
Loading package random-1.0.0.3 ... linking ... done.
Loading package haskell98-1.1.0.1 ... linking ... done.
Loading package cairo-0.12.0 ... linking ... <interactive>: C:\Users\daniel\AppD
ata\Roaming\cabal\cairo-0.12.0\ghc-7.0.2\HScairo-0.12.0.o: unknown symbol `_cair
o_image_surface_get_data'
ghc.exe: unable to load package `cairo-0.12.0'
*Main>

Compiling with ghc --make Drawing.hs -o main runs OK

But when I try to build i. e. the Chart package it fails with the above error.

Change History

Changed 3 years ago by guest

This also happens when I combine Template Haskell and Gtk. Surprisingly, I only see this happen in windows, the same code works ok in Ubuntu, using ghc-6.12. So that you can test it, I'm using TH to generate code like the one that follows:

closeBtn :: Builder -> IO Button
closeBtn = onBuilder castToButton "closeBtn"

providing only "closeBtn" and "Button".

I checked that the function did exist in the libraries and includes I was specifying with extra-include-dirs and extra-lib-dirs, and that pkg-config was providing the right paths for cairo.

-- Ivan Perez (ivan.perez ... keera dot es)

PS. I'm singing the message as I couldn't find a way to add myself to the CC field using the guest user.

Note: See TracTickets for help on using tickets.