问题
If you import Gloss within a Stack project and use stack ghci
, you get the following error:
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
<command line>: can't load .so/.DLL for: /Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/lib/x86_64-osx-ghc-7.10.2/GLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv/libHSGLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv-ghc7.10.2.dylib (dlopen(/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/lib/x86_64-osx-ghc-7.10.2/GLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv/libHSGLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv-ghc7.10.2.dylib, 5): Symbol not found: _glutBitmap8By13
Referenced from: /Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/lib/x86_64-osx-ghc-7.10.2/GLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv/libHSGLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv-ghc7.10.2.dylib
Expected in: flat namespace
in /Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/lib/x86_64-osx-ghc-7.10.2/GLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv/libHSGLUT-2.7.0.3-FFXiDYE1CfiDHjNKroBerv-ghc7.10.2.dylib)
How can that be fixed?
回答1:
Tried this in my system and it worked:
cabal install GLUT --ghc-options="-optl-Wl,-framework,GLUT" --reinstall --jobs=1
I found this solution here: Trouble building applications with Haskell GLUT and freeglut on OS X with GHC 7.10.1
来源:https://stackoverflow.com/questions/33288131/stack-ghci-fails-when-you-include-a-project-which-imports-gloss