Jump to content

Haskell '.hs' file compile problems...

- - - - -

  • Please log in to reply
3 replies to this topic

#1
abderrahim

abderrahim

    Newbie

  • Members
  • PipPip
  • 14 posts
  • Programming Language:C, Java, PHP, Perl, Pascal, Assembly, Haskell
  • Learning:C, Java, PHP, JavaScript, PL/SQL, Assembly, Haskell
Hi everybody,
Everytime I want to compile a Haskell .hs file with Ghci, it fails as shown in the picture.
please I need help, I'm a newbie!!
Attached File  Capture.PNG   12.15K   14 downloads
aaa another thing may be in relationn, here is the source code of the file
import Graphics.Rendering.OpenGL

import Graphics.UI.GLUT

 

main :: IO ()

main = do 

  (progname, _) <- getArgsAndInitialize

  createWindow "Hello World"

  displayCallback $= flush

  mainLoop


#2
Sysop_fb

Sysop_fb

    Programmer

  • Members
  • PipPipPipPip
  • 160 posts
  • Location:Missouri
ghc is a command line utility to compile haskell source code

ghci is the haskell interpreter


Quote

jason@db-box:~/haskell$ cat cc.hs
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT

main :: IO ()
main = do
(progname, _) <- getArgsAndInitialize
createWindow "Hello World"
displayCallback $= flush
mainLoop
jason@db-box:~/haskell$ ghc --make cc.hs
[1 of 1] Compiling Main ( cc.hs, cc.o )
Linking cc ...

If instead of compiling the code you want to run it through the inerpreter then just load it up into ghci

Quote

jason@db-box:~/haskell$ ghci
GHCi, version 6.12.1: The Glasgow Haskell Compiler :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :load cc.hs
Ok, modules loaded: Main.
Prelude Main>

"The best optimizer is between your ears" - Michael Abrash
Saying you can optimize a program is like saying you understand how a program works on every level of every facet on a specific machines configuration.

#3
abderrahim

abderrahim

    Newbie

  • Members
  • PipPip
  • 14 posts
  • Programming Language:C, Java, PHP, Perl, Pascal, Assembly, Haskell
  • Learning:C, Java, PHP, JavaScript, PL/SQL, Assembly, Haskell
ok, thank you,
there is another issue i'm dealing with, after compiling and running the .exe file, I end up with a dll missing file called "glut32".
So Thanks in advance....

#4
Sysop_fb

Sysop_fb

    Programmer

  • Members
  • PipPipPipPip
  • 160 posts
  • Location:Missouri
Might need to install the haskell glut binding. It seems like you're using windows?
I don't know how to do it on windows on linux I just use cabal but I found this from hackage
Less Sugar/More Meat » Blog Archive » freeglut + Windows + HOpenGL + HGLUT
"The best optimizer is between your ears" - Michael Abrash
Saying you can optimize a program is like saying you understand how a program works on every level of every facet on a specific machines configuration.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users