Subject: Re: [HOpenGL] How to compile a hopengl program?
From: Bas van Dijk <[email-masked]>
To: Sven Panne <[email-masked]>
Date: Mon, 21 Apr 2003 12:33:31 +0200

Hi,

Thx for the reply!

I built GHC from sources using --enable-hopengl at configuration time.

(I use a Gentoo Linux box so the only thing I had  to do to install GHC is 
type the command: "USE=opengl emerge ghc".)

This is the output of the commands you specified:
------------------------------------------------------------
> ghc-pkg --list-packages
rts, base, haskell98, network, haskell-src, OpenGL, GLUT, lang,
concurrent, posix, util, data, text, net, hssource

> ghc-pkg --show-package=HOpenGL
can't find package `HOpenGL'

> ghc-pkg --show-package=OpenGL
Package
   {name = "OpenGL",
    import_dirs = ["$libdir/imports/OpenGL"],
    source_dirs = [],
    library_dirs = ["$libdir"],
    hs_libraries = ["HSOpenGL"],
    extra_libraries = [],
    include_dirs = [],
    c_includes = ["GL/glu.h"],
    package_deps = ["base"],
    extra_ghc_opts = [],
    extra_cc_opts = ["", "-I/usr/X11R6/include"],
    extra_ld_opts =
      ["",
       "-lglut",
       "-lGLU",
       "-lGL",
       "-lSM",
       "-lICE",
       "-L/usr/X11R6/lib",
       "-lX11",
       "-lXext",
       "-lXmu",
       "-lXt",
       "-lXi",
       "-lm"],
    framework_dirs = [],
    extra_frameworks = []}

> ghc-pkg --show-package=GLUT
Package
   {name = "GLUT",
    import_dirs = ["$libdir/imports/GLUT"],
    source_dirs = [],
    library_dirs = ["$libdir"],
    hs_libraries = ["HSGLUT"],
    extra_libraries = ["HSGLUT_cbits"],
    include_dirs = [],
    c_includes = ["HsGLUT.h"],
    package_deps = ["OpenGL"],
    extra_ghc_opts = [],
    extra_cc_opts = ["", "-I/usr/X11R6/include"],
    extra_ld_opts =
      ["",
       "-lglut",
       "-lGLU",
       "-lGL",
       "-lSM",
       "-lICE",
       "-L/usr/X11R6/lib",
       "-lX11",
       "-lXext",
       "-lXmu",
       "-lXt",
       "-lXi",
       "-lm"],
    framework_dirs = [],
    extra_frameworks = []}
------------------------------------------------------------

So I gues OpenGL is setup correctly...

Do you know what I have to "import" in my hopengl programs in order to make it 
compile?

Greetings,
Bas.

On Monday 21 April 2003 12:11, you wrote:
> Bas van Dijk wrote:
>  > [...] Does it have something to do with a wrong packagename???
>
> The package name depends on the OpenGL version you are using:
>
> * If you downloaded HOpenGL-1.04 separately, you get a package named
>    "HOpenGL", containing GL/GLU/GLUT. Note that there is a small bug in
>    the "install" target of lib/Makefile.in, so you have to copy GLUT's
>    *.hi files to the installation destination by hand. Hmmmm, perhaps I
>    should post a patch for this and update my HOpenGL pages a bit...
>
> * If you built GHC from sources, using --enable-hopengl at
>    configuration time, you get an "OpenGL" package containing GL/GLU
>    and a "GLUT" package containing, well, GLUT. But the OpenGL stuff in
>    the 5.04 branch is rather incomplete, the current CVS HEAD is much
>    better in this respect. Note that even the HEAD is not finished yet,
>    but people at the bleeding edge can take a look at what the new API
>    will look like.
>
> What is the output of the following commands?
>
>     ghc-pkg --list-packages
>     ghc-pkg --show-package=HOpenGL
>     ghc-pkg --show-package=OpenGL
>     ghc-pkg --show-package=GLUT
>
> Cheers,
>     S.