GLUT (glutGet undefined reference)

Hi all, I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic). I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my screen is filled with errors. The errors begin with: /home/paul/.cabal/lib/GLUT-2.1.1.2/ghc-6.8.2/libHSGLUT-2.1.1.2.a(Begin.o): In function `szEn_info': (.text+0x26c): undefined reference to `glutGet' This surprised me a little because I've already seen these same errors recently on two separate Windows boxes. Somehow I'd got the idea it was (on Windows) due to installing from a binary; though I guess the story is the same with apt-get. Should I look for an apt-get switch to reinstall GHC from source instead? Regards, Paul

Have you tried http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/
?
2009/1/20 Paul Keir
Hi all,
I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic).
I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my screen is filled with errors. The errors begin with:
/home/paul/.cabal/lib/GLUT-2.1.1.2/ghc-6.8.2/libHSGLUT-2.1.1.2.a(Begin.o): In function `szEn_info': (.text+0x26c): undefined reference to `glutGet'
This surprised me a little because I've already seen these same errors recently on two separate Windows boxes. Somehow I'd got the idea it was (on Windows) due to installing from a binary; though I guess the story is the same with apt-get. Should I look for an apt-get switch to reinstall GHC from source instead?
Regards, Paul
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Евгений Кирпичев Разработчик Яндекс.Маркета

Ouch. Sorry, I misread your post: I thought you were having troubles on Windows.
2009/1/20 Eugene Kirpichov
Have you tried http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/ ?
2009/1/20 Paul Keir
: Hi all,
I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic).
I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my screen is filled with errors. The errors begin with:
/home/paul/.cabal/lib/GLUT-2.1.1.2/ghc-6.8.2/libHSGLUT-2.1.1.2.a(Begin.o): In function `szEn_info': (.text+0x26c): undefined reference to `glutGet'
This surprised me a little because I've already seen these same errors recently on two separate Windows boxes. Somehow I'd got the idea it was (on Windows) due to installing from a binary; though I guess the story is the same with apt-get. Should I look for an apt-get switch to reinstall GHC from source instead?
Regards, Paul
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Евгений Кирпичев Разработчик Яндекс.Маркета

2009/1/19 Paul Keir
I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic).
I'm sorry, I can't help you with your problem. But I'd recommend you using GLFW, it's a lot easier to build and use on Linux and on Windows (I never managed to install GLUT on Windows). There are some functions from GLUT that it doesn't have, but most of the time you don't use them anyway. HTH, -- Felipe.

Check this thread:
http://groups.google.com/group/fa.haskell/browse_thread/thread/1716fa5e56435...
Kazuya
2009/1/20 Paul Keir
Hi all,
I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic).
I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my screen is filled with errors. The errors begin with:
/home/paul/.cabal/lib/GLUT-2.1.1.2/ghc-6.8.2/libHSGLUT-2.1.1.2.a(Begin.o): In function `szEn_info': (.text+0x26c): undefined reference to `glutGet'
This surprised me a little because I've already seen these same errors recently on two separate Windows boxes. Somehow I'd got the idea it was (on Windows) due to installing from a binary; though I guess the story is the same with apt-get. Should I look for an apt-get switch to reinstall GHC from source instead?
Regards, Paul
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Thanks Kazuya, that link is perfect.
Basically, I have to explicitly add -lglut :
ghc -package GLUT -lglut HelloWorld.hs -o HelloWorld
Great. GLUT (and now FreeGLUT) remains the simplest
and most reliable "standard" cross-platform OpenGL
windowing API.
(It seems from the link that the information used by
ghc-pkg is wrong, and stems from the GLUT package's
relationship to libraries known as Xmu and Xi.)
Cheers,
Paul
-----Original Message-----
From: Kazuya Sakakihara [mailto:kazuya@gmail.com]
Sent: Thu 22/01/2009 02:14
To: Paul Keir
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] GLUT (glutGet undefined reference)[MESSAGE NOT SCANNED]
Check this thread:
http://groups.google.com/group/fa.haskell/browse_thread/thread/1716fa5e56435...
Kazuya
2009/1/20 Paul Keir
Hi all,
I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic).
I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my screen is filled with errors. The errors begin with:
/home/paul/.cabal/lib/GLUT-2.1.1.2/ghc-6.8.2/libHSGLUT-2.1.1.2.a(Begin.o): In function `szEn_info': (.text+0x26c): undefined reference to `glutGet'
This surprised me a little because I've already seen these same errors recently on two separate Windows boxes. Somehow I'd got the idea it was (on Windows) due to installing from a binary; though I guess the story is the same with apt-get. Should I look for an apt-get switch to reinstall GHC from source instead?
Regards, Paul
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Eugene Kirpichov
-
Felipe Lessa
-
Kazuya Sakakihara
-
Paul Keir