2

I am writing a small application using the gtk2hs, but i get the below error on running the application.

required gtk+ version 3.10, current version is 2.24

Also i checked (using ldd) that the below library is linked to my application.

libgtk-x11-2.0.so.0 => /lib64/libgtk-x11-2.0.so.0 (0x00000036aee00000)

I do have gtk version 3 installed on my machine. But still the application is using the version 2 of library.

/lib64/libgtk-3.so
/lib64/libgtk-3.so.0

How can I resolve this issue? Do I need to specify some GHC argument to link the gtk3 lib?

dfordivam
  • 169
  • 1
  • 6
  • 1
    Have you installed the `gtk3` package in Haskell (rather than `gtk`)?: https://hackage.haskell.org/package/gtk3 – vivian Sep 25 '14 at 06:37

1 Answers1

2

The correct solution is mentioned by vivian. Here I am adding a couple of more things which were required to get the application working.

First install gtk3

cabal install gtk3

Then specify that you want to use the gtk3 package. (As the below functionality is present in both "gtk" and "gtk3" packages)

import "gtk3" Graphics.UI.Gtk

and finally compile with

ghc -XPackageImports file.hs

dfordivam
  • 169
  • 1
  • 6