Rupert Ehringer
Rupert Ehringer

Reputation: 43

installing haskell package gtkglext on mac

I would like to use Graphics.UI.Gtk.OpenGL

I have:

The error I get:

Could not find module ‘Graphics.UI.Gtk.OpenGL’
  Perhaps you meant
    Graphics.UI.Gtk.Gdk.GC (from gtk-0.14.2)
    Graphics.UI.Gtk.Cairo (from gtk-0.14.2)
    Graphics.UI.Gtk.Gdk.Gdk (from gtk-0.14.2)
  Use -v to see a list of the files searched for.`

I'm trying to install gtkglext using:

cabal install gtkglext 

But then I get:

Resolving dependencies...
Configuring glib-0.12.5.4...
Building glib-0.12.5.4...
Failed to install glib-0.12.5.4
Build log ( /Users/Martin/.cabal/logs/glib-0.12.5.4.log ):
[1 of 2] Compiling SetupWrapper     (         /var/folders/4p/yw17gzsd4554drxtxmbdd24c0000gn/T/glib-0.12.5.4-1526/glib-   0.12.5.4/SetupWrapper.hs, /var/folders/4p/yw17gzsd4554drxtxmbdd24c0000gn/T/glib-0.12.5.4-1526/glib-0.12.5.4/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/4p/yw17gzsd4554drxtxmbdd24c0000gn/T/glib-0.12.5.4-1526/glib-0.12.5.4/dist/setup/setup.hs, /var/folders/4p/yw17gzsd4554drxtxmbdd24c0000gn/T/glib-0.12.5.4-1526/glib-0.12.5.4/dist/setup/Main.o )
Linking /var/folders/4p/yw17gzsd4554drxtxmbdd24c0000gn/T/glib-0.12.5.4-1526/glib-0.12.5.4/dist/setup/setup ...
[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 ...
Configuring glib-0.12.5.4...
Building glib-0.12.5.4...
Preprocessing library glib-0.12.5.4...
gtk2hsC2hs: Error in C header file.

/usr/include/dirent.h:150: (column 10) [FATAL] 
  \>>> Syntax error!
  The symbol `^' does not fit here.

cabal: Error: some packages failed to install:
gio-0.12.5.3 depends on glib-0.12.5.4 which failed to install.
glib-0.12.5.4 failed during the building phase. The exception was:
ExitFailure 1
gtk-0.12.5.7 depends on glib-0.12.5.4 which failed to install.
gtkglext-0.12.5.0 depends on glib-0.12.5.4 which failed to install.
pango-0.12.5.3 depends on glib-0.12.5.4 which failed to install.`

So what I found out is, gtkglext has dependency glib (>=0.12.5.0 && <0.13), and I cannot install glib version in this range because of this error, does it mean I can't use gtkglext?

EDIT:-------------------------------------------------------------------

Installing with

cabal install gtkglext  --with-gcc=gcc-4.8

produces another error, which is:

Graphics/UI/Gtk/General/Structs.hsc:660:3: Couldn't match type ‘CInt’ with ‘Ptr a0’ Expected type: IO (Ptr a0) Actual type: IO CInt In the second argument of ‘($)’, namely ‘(\ (Drawable drawable) -> withForeignPtr drawable gdk_x11_drawable_get_xid) (toDrawable d)’ In the expression: liftM toNativeWindowId $ (\ (Drawable drawable) -> withForeignPtr drawable gdk_x11_drawable_get_xid) (toDrawable d)

Little of googling produces: https://github.com/gtk2hs/gtk2hs/issues/27

But I dont know how did he "have just disabled drawableGetID completely and that seems to work ok."

Any help would be useful.

Upvotes: 1

Views: 293

Answers (1)

ErikR
ErikR

Reputation: 52039

The key is this error message:

/usr/include/dirent.h:150: (column 10) [FATAL] >>> Syntax error! The symbol `^' does not fit here.

Googling that message leads to his issue on github:

https://github.com/gtk2hs/gtk2hs/issues/1

The suggested fix is to run cabal with:

cabal install --with-gcc=gcc-4.8

So - perhaps upgrade your version of gcc and use the --with-gcc= flag if you need to.

Upvotes: 2

Related Questions