Hi!
I'd like to ask you to help me to compile OpenGL haskell binding with jhc.
Currently I have installed jhc 0.6. (I'm on Arch Linux x86 32 bit)
Here is the first issue:
jhc -v -f cpp --build-hl OpenGL.cabaljhc -v -f cpp --build-hl OpenGL.cabaljhc 0.6.0 (0.6.0-0)Creating library from description file: "OpenGL.cabal"
Reading: "OpenGL.cabal"Loading libraries: ["base","haskell98"]Library: base-1.0 </usr/share/jhc-0.5/base-1.0.hl>
Library: haskell98-1.0 </usr/share/jhc-0.5/haskell98-1.0.hl>Graphics.Rendering.OpenGL [./Graphics/Rendering/OpenGL.hs]Graphics.Rendering.OpenGL.GL [./Graphics/Rendering/OpenGL/GL.hs]
Graphics.Rendering.OpenGL.GL.Antialiasing [./Graphics/Rendering/OpenGL/GL/Antialiasing.hs]./Graphics/Rendering/OpenGL/GL/BasicTypes.hs:24: error: HsOpenGLConfig.h: No such file or directory
cpp exited abnormally
It seemed that i have to specify the inlcude dir. With include dir passing here is the second error:
jhc -v -f cpp -I include --build-hl OpenGL.cabal
jhc -v -f cpp -I include --build-hl OpenGL.cabaljhc 0.6.0 (0.6.0-0)Creating library from description file: "OpenGL.cabal"Reading: "OpenGL.cabal"Loading libraries: ["base","haskell98"]
Library: base-1.0 </usr/share/jhc-0.5/base-1.0.hl>Library: haskell98-1.0 </usr/share/jhc-0.5/haskell98-1.0.hl>Graphics.Rendering.OpenGL [./Graphics/Rendering/OpenGL.hs]
Graphics.Rendering.OpenGL.GL [./Graphics/Rendering/OpenGL/GL.hs]Graphics.Rendering.OpenGL.GL.Antialiasing [./Graphics/Rendering/OpenGL/GL/Antialiasing.hs]
include/HsOpenGLConfig.h:1:1: Parse error
I've checked what is the cpp's output and it still contains preprocessor macros. e.g.: #line ....
Any idea?
Here is the alternative way what i was tried:
cabal --jhc install openglResolving dependencies... Configuring OpenGL-2.2.1.1... checking for gcc... gcc
checking for C compiler default output file name... a.outchecking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables...
checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed
checking for Windows environment... no checking how to run the C preprocessor... gcc -E checking for X... libraries , headers checking for gethostbyname... yes
checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes
checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for atan... no
checking for atan in -lm... yes checking for GL library... -lGL -lm checking for GLU library... -lGLU -lGL -lm checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes
checking for stdlib.h... yes checking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yes
checking for stdint.h... yeschecking for unistd.h... yeschecking GL/gl.h usability... yeschecking GL/gl.h presence... yeschecking for GL/gl.h... yeschecking OpenGL/gl.h usability... no
checking OpenGL/gl.h presence... nochecking for OpenGL/gl.h... nochecking GL/glu.h usability... yeschecking GL/glu.h presence... yeschecking for GL/glu.h... yeschecking OpenGL/glu.h usability... no
checking OpenGL/glu.h presence... nochecking for OpenGL/glu.h... nochecking Haskell type for GLboolean... Word8checking Haskell type for GLbyte... Int8checking Haskell type for GLubyte... Word8
checking Haskell type for GLshort... Int16checking Haskell type for GLushort... Word16checking Haskell type for GLint... Int32checking Haskell type for GLuint... Word32checking Haskell type for GLsizei... Int32
checking Haskell type for GLenum... Word32checking Haskell type for GLbitfield... Word32checking Haskell type for GLfloat... Floatchecking Haskell type for GLclampf... Floatchecking Haskell type for GLdouble... Double
checking Haskell type for GLclampd... Doublechecking Haskell type for GLchar... Int8checking Haskell type for GLintptr... Int32checking Haskell type for GLsizeiptr... Int32configure: creating ./config.status
config.status: creating config.mkconfig.status: creating OpenGL.buildinfoconfig.status: creating include/HsOpenGLConfig.hconfig.status: creating include/HsOpenGL.h
config.status: include/HsOpenGL.h is unchangedPreprocessing library OpenGL-2.2.1.1...Building OpenGL-2.2.1.1..../Graphics/Rendering/OpenGL/GL/BasicTypes.hs:24: error: HsOpenGLConfig.h: No such file or directory
cpp exited abnormallycabal: Error: some packages failed to install:OpenGL-2.2.1.1 failed during the building phase. The exception was:exit: ExitFailure 1