acowley / GLUtil

Utility functions for working with OpenGL BufferObjects, GLSL shaders, and textures.
BSD 3-Clause "New" or "Revised" License
40 stars 16 forks source link

Examples didn't compile: ambiguous occurences everywhere #2

Closed minosniu closed 12 years ago

minosniu commented 12 years ago

I tried to run the opengl examples found in the repo (examples/lesson3b.hs). With self-compiled haskell-platform, ghc 7.0. 4 on ubuntu 10.10, the examples kept reporting compile error of "ambiguous occurrence". The conflict came from "> import Graphics.Rendering.OpenGL" and "> import Graphics.UI.GLUT". Interestingly all other running codes started reporting such errors after GLUtil was installed. It does seem to me that installing GLUtil lead to the error.

Any thoughts? Also could you provide more detail on what environment you were testing your examples with? Thanks!

minosniu commented 12 years ago

I solved this issue. Now the example is running all right. I had to manually change the package dependency in GLUtil.cabal, just to make sure both OpenGL and OpenGLRaw match the versions that I installed. Cabal dependency management is a disaster.

acowley commented 12 years ago

This sounds like installing GLUtil left you with OpenGL and GLUT installed on your system twice. Inspecting the output of ghc-pkg list OpenGL or even cabal list OpenGL should shed some light on where things went wrong. I've pushed a patch that relaxes the version constraints in GLUtil.cabal so it won't pull in an older OpenGL. You can use ghc-pkg unregister to remove the older versions of OpenGL that may have been installed. If you want to keep multiple versions of OpenGL or GLUT, then you can use a .cabal file to build examples/lesson3b.lhs so you can specify which versions of OpenGL and GLUT you want to use.

EDIT: Our comments went past each other! Sorry you had installation troubles, it is more forgiving now.