Trouble building applications with Haskell GLUT and freeglut on OS X with GHC 7.10.1
Jérome Mahuet
jerome.mahuet at gmail.com
Mon Jun 22 10:56:41 UTC 2015
Hello,
When I depend on the GLUT Haskell package (2.6 or newer) on GHC 7.10.1
on OS X 10.10.3, the GLUT package builds and installs successfully,
but applications that depend on GLUT fail during cabal install with
this kind of linking error:
can't load .so/.DLL for:
/Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib
(dlopen(/Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib,
5): Symbol not found: _glutBitmap8By13
Referenced from:
/Users/jdsandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib
Expected in: flat namespace
in /Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib)
Occurs when trying to load GLUT to GHCi.
$ ghci -package GLUT
I tried loading the OSX's GLUT.framework manually:
$ ghci -framework GLUT -package GLUT
but it produces the same error message.
To be sure I checked the OSX's GLUT.framework, it does contain the
_glutBitmap8By13 symbol.
It's also worth noticing that this only occurs on OS X with GHC 7.10.1
and cabal 1.22.*.
linux + ghc 7.10.1 = Ok
mac + ghc 7.10.1 = Fail
mac + ghc 7.8.4 = Ok
I'm not sure if this is a GHC or Cabal bug, but something is working
differently on Mac with GHC 7.10.1/cabal 1.22.*
Did you guys encounter something similar, is there a work-around we
can do inside the GLUT Haskell package?
More information about the Glasgow-haskell-users
mailing list