Frage

I get an error when i try to import GLUT package

import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT

The error i am getting is :

error

I don't know how to use Graphics in haskell,

Tell me how i can import GLUT package if it says WinHugs can't find Graphics.UI.GLUT package.

Update: It would be really nice to get a video link, to understand it fast.

War es hilfreich?

Lösung

WinHugs is really old, and hasn't been updated since 2006. Please switch to the Haskell Platform which uses the GHC compiler instead. If you do that, your code will work out-of-the-box, because the GLUT package is included in the Platform by default.

Andere Tipps

This means you are using WinHugs with minimal collection of libraries and that's why you are not facing any problem with import Graphics.Rendering.OpenGL but as you said import Graphics.UI.GLUT is not working in your WinHugs, this means you need to add GLUT package in your WinHugs libraries.

This is a link through which you can get the WinHugs, other programs, and a large collection of libraries.

  • Some of the library packages are built only if the system you're building on is set up for compilation with certain C libraries. In particular you get the Haskell X11 and HGL packages only if X11 libraries are available to you, and the OpenGL, GLUT, OpenAL and ALUT packages only if the corresponding C libraries are already present.


So, After too much research and study I finally got my solution from myself.
Graphics in Haskell is not a big deal if you are using Haskell Platform, It would be really a tedious task and most probably impossible to work with graphics in WinHugs.

So you should first download & install haskell platform on your machine then you have to download and install(copy) GLUT packages in your system folder and this will enable you to use them.
For more information you can watch my own youtube video which I've uploaded on my youtube account for quick instruction guide.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top