Fwd: Re: [HOpenGL] How to compile a hopengl program?

Bas van Dijk basvandijk@home.nl
Mon, 21 Apr 2003 13:14:32 +0200


--Boundary-00=_YK9o+2ZPsjJKwIe
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline



--Boundary-00=_YK9o+2ZPsjJKwIe
Content-Type: message/rfc822;
  name="forwarded message"
Content-Transfer-Encoding: 8bit
Content-Description: Bas van Dijk <basvandijk@home.nl>: Re: [HOpenGL] How to compile a hopengl program?

From: Bas van Dijk <basvandijk@home.nl>
To: Sven Panne <Sven.Panne@informatik.uni-muenchen.de>
Subject: Re: [HOpenGL] How to compile a hopengl program?
Date: Mon, 21 Apr 2003 12:33:31 +0200
User-Agent: KMail/1.5.1
References: <200304210138.11661.basvandijk@home.nl> <3EA3C3E0.1090609@informatik.uni-muenchen.de>
In-Reply-To: <3EA3C3E0.1090609@informatik.uni-muenchen.de>
X-KMail-Link-Message: 518
X-KMail-Link-Type: reply
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304211233.31565.basvandijk@home.nl>
Status: RO
X-Status: S
X-KMail-EncryptionState:  
X-KMail-SignatureState:  

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.

--Boundary-00=_YK9o+2ZPsjJKwIe--