[HOpenGL] problems running SmoothOpenGL3

Michael [Plouj] Ploujnikov ploujj at gmail.com
Fri Jul 31 11:25:45 EDT 2009


Hi,
I wanted to give the new SmoothOpenGL3.hs example a try, but I ran
into a strange problem with it.

Prior to trying this example, I unregistered the old OpenGL and GLUT
packages and installed new ones with cabal. Below is a list of all the
Haskell packages on my system:

$ ghc-pkg list
/usr/lib64/ghc-6.10.3/./package.conf:
    Cabal-1.6.0.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0, X11-1.4.5,
    array-0.2.0.0, base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4,
    containers-0.2.0.1, directory-1.0.0.3, (dph-base-0.3),
    (dph-par-0.3), (dph-prim-interface-0.3), (dph-prim-par-0.3),
    (dph-prim-seq-0.3), (dph-seq-0.3), extensible-exceptions-0.1.1.0,
    filepath-1.1.0.2, (ghc-6.10.3), ghc-prim-0.1.0.0, haddock-2.4.2,
    haskell-src-1.0.1.3, haskell98-1.0.1.0, hpc-0.5.0.3, html-1.0.1.2,
    integer-0.1.0.1, mtl-1.1.0.2, network-2.2.1, old-locale-1.0.0.1,
    old-time-1.0.0.2, packedstring-0.1.0.1, parallel-1.1.0.1,
    parsec-2.1.0.1, pretty-1.0.1.0, process-1.0.1.1, random-1.0.0.1,
    regex-base-0.72.0.2, regex-compat-0.71.0.1, regex-posix-0.72.0.3,
    rts-1.0, stm-2.1.1.2, syb-0.1.0.1, template-haskell-2.3.0.1,
    time-1.1.3, unix-2.3.2.0, xhtml-3000.2.0.1, xmonad-0.8.1
/home/plouj/.ghc/x86_64-linux-6.10.3/package.conf:
    GLURaw-1.0.0.0, GLUT-2.2.0.0, ObjectName-1.0.0.0, OpenGL-2.3.0.0,
    OpenGLRaw-1.0.1.0, SDL-0.5.5, StateVar-1.0.0.0, Tensor-1.0.0.1,
    X11-xft-0.3, hinotify-0.2, utf8-string-0.3.5, xmonad-contrib-0.8.1


I copied SmoothOpenGL3.hs from the GLUT-2.2.0.0.tar.gz tarball into
the current directory and here is what happened when I tried running
it with runghc:

$ runghc  SmoothOpenGL3.hs
SmoothOpenGL3.hs:
/home/plouj/.cabal/lib/GLUT-2.2.0.0/ghc-6.10.3/HSGLUT-2.2.0.0.o:
unknown symbol `glutGet'
SmoothOpenGL3.hs: SmoothOpenGL3.hs: unable to load package `GLUT-2.2.0.0'
$ ghc-pkg list|grep GLUT
    GLURaw-1.0.0.0, GLUT-2.2.0.0, ObjectName-1.0.0.0, OpenGL-2.3.0.0,

$ nm /home/plouj/.cabal/lib/GLUT-2.2.0.0/ghc-6.10.3/HSGLUT-2.2.0.0.o|grep
glutGet
0000000000007720 D
GLUTzm2zi2zi0zi0_GraphicsziUIziGLUTziState_ptrzuglutGetModeValues_closure
0000000000045060 T
GLUTzm2zi2zi0zi0_GraphicsziUIziGLUTziState_ptrzuglutGetModeValues_info
                 U glutGet
                 U glutGetColor
                 U glutGetMenu
                 U glutGetModifiers
                 U glutGetProcAddress
                 U glutGetWindow

I get a similar problem in ghci:

$ ghci
GHCi, version 6.10.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> :l SmoothOpenGL3.hs
[1 of 1] Compiling Main             ( SmoothOpenGL3.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
Loading package syb ... linking ... done.
Loading package base-3.0.3.1 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package containers-0.2.0.1 ... linking ... done.
Loading package OpenGLRaw-1.0.1.0 ... linking ... done.
Loading package GLURaw-1.0.0.0 ... linking ... done.
Loading package ObjectName-1.0.0.0 ... linking ... done.
Loading package StateVar-1.0.0.0 ... linking ... done.
Loading package Tensor-1.0.0.1 ... linking ... done.
Loading package OpenGL-2.3.0.0 ... linking ... done.
Loading package GLUT-2.2.0.0 ... linking ... <interactive>:
/home/plouj/.cabal/lib/GLUT-2.2.0.0/ghc-6.10.3/HSGLUT-2.2.0.0.o:
unknown symbol `glutGet'
ghc: unable to load package `GLUT-2.2.0.0'

Finally, this is what I get if I try to compile with 'ghc --make':

$ ghc --make -lglut SmoothOpenGL3.hs # the linker fails without -lglut
similar to this:
http://www.haskell.org/pipermail/hopengl/2008-September/000756.html
[1 of 1] Compiling Main             ( SmoothOpenGL3.hs, SmoothOpenGL3.o )
Linking SmoothOpenGL3 ...
$ ./SmoothOpenGL3
SmoothOpenGL3: user error (unknown GLUT call glutInitContextVersion,
check for freeglut)
$ ldd ./SmoothOpenGL3
	linux-vdso.so.1 =>  (0x00007fffd25ff000)
	libglut.so.3 => /usr/lib64/libglut.so.3 (0x000000323c000000)
	libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x0000003242000000)
	libGL.so.1 => /usr/lib64/libGL.so.1 (0x0000003241c00000)
	libm.so.6 => /lib64/libm.so.6 (0x0000003239400000)
	libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x000000323bc00000)
	libdl.so.2 => /lib64/libdl.so.2 (0x0000003239800000)
	librt.so.1 => /lib64/librt.so.1 (0x000000323a400000)
	libc.so.6 => /lib64/libc.so.6 (0x0000003239000000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x000000323b400000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x000000323a800000)
	libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x0000003248a00000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003243e00000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003241000000)
	libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x000000323ec00000)
	libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x000000323cc00000)
	libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x0000003242400000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003239c00000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003238c00000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x000000323ac00000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x000000323b000000)

I'm not sure if this problem is specific to my setup or if it's a bug
in the new GLUT/OpenGL packages. I would appreciate any help either
way.

-- 
http://plouj.com/


More information about the HOpenGL mailing list