Hi, now, I had this problem :((((( [root@PANDORA ~]# ghc --make Planet.hs Chasing modules from: Planet.hs Skipping Main ( Planet.hs, Planet.o ) Linking ... /usr/bin/ld: cannot find -lglut collect2: ld returned 1 exit status Thanks, Sandra Patrick Scheibe <mai99dnn@studserv.uni-leipzig.de> escreveu:Hi, Ok, there are some things you have to know: 1. You have to tell ghc, that you want the HOpenGl Package when you compile some stuff that needs HOpenGL. You can do this with ghc -package OpenGL 2. It is maybe a good idea to use the --make option. That checks the dependencies. I think that will not solve your problem. For some reason the ghc doesn't find the right files. It looks like that you use the (old) samples from the separate HOpenGL package. You have to use the samples from the ghc source under: ghc-6.4/libraries/GLUT/examples/RedBook/Planet.hs That is very important because the HOpenGL package from the website is very different from the ghc HOpenGL package. These two things have different APIs... So try this: Go to the ghc website and download the ghc6.4 source. Go to the path: libraries/GLUT/examples/RedBook/ and then try to compile the sample with ghc --make -package OpenGL Planet.hs This should work. Cheers Patrick On Monday 02 May 2005 16:58, Sandra Fontes wrote:
Hi,
I installed GHC 6.4, but I don´t know how to running a program, like Planet.hs. I had this problem:
[root@medusaLinux redbook_HS]# ghc Planet.hs -v Glasgow Haskell Compiler, Version 6.4, for Haskell 98, compiled by GHC version 5.04.3 Using package config file: /usr/local/lib/ghc-6.4/package.conf Hsc static flags: -static *** Checking old interface for Main: *** Parser: *** Renamer/typechecker: Planet.hs:15:0: Failed to load interface for `GL': Could not find module ` GL': locations searched: GL.hi GL.hi-boot *** Deleting temp files Deleting: /tmp/ghc3765.s Warning: deleting non-existent /tmp/ghc3765.s
Thanks, Sandra
Lemmih wrote:
On 4/28/05, Sandra Fontes wrote:
Hi,
At installation of HOpenGL, I had this problem:
[snip]
HOpenGL is not a stand-alone package any more. Just install GHC 6.4 and it'll be there.
--------------------------------- Yahoo! Acesso Grátis: Internet rápida e grátis. Instale o discador agora!
Ok, It seems you are a really newbie. It is hard to understand such problems when you never did something in OpenGL. A short summery: OpenGl is only the graphic engine providing you with fast drawing operations, textures, polygons, affine transformations, ... If you want to programm some graphical thing using OpenGl, then you have to ensure that the libraries you want to use are on your machine. That means anywhere, in a reachable path has to lie a libgl. BUT that is in most cases not enough, because you (or the Planet.hs sample) need(s) to open a window, where you(it) have(has) to draw in. A very simple way is to use the GLUT library. With the functions of this library you can simple open a window and use it for your graphics: (progName, _args) <- getArgsAndInitialize initialDisplayMode $= [ DoubleBuffered, RGBMode ] initialWindowSize $= Size 500 500 initialWindowPosition $= Position 100 100 createWindow progName All HOpenGl haskell things use the c-libraries. When you compile a HOpenGl-prog and you don't have the underlying c-libs then this happens:
Linking ... /usr/bin/ld: cannot find -lglut collect2: ld returned 1 exit status
because the linker, putting all things finaly together can't find the needed glut library. You should ensure that you have following things on your machine: the gl library the glu lib and the glut lib on my suse box they are here: /usr/lib/libMesaGLU.so.3 /usr/lib/libMesaGL.a /usr/lib/libGLU.la /usr/lib/libGLU.so /usr/lib/libMesaGL.la /usr/lib/libMesaGL.so /usr/lib/libGLU.so.1 /usr/lib/libGL.la /usr/lib/libGL.so /usr/lib/libGLU.a /usr/lib/libglut.a /usr/lib/libglut.so.3 /usr/lib/libglut.la /usr/lib/libglut.so Good luck Patrick
participants (2)
-
Patrick Scheibe -
Sandra Fontes