[HOpenGL] -O strangeness
Wolfgang Thaller
wolfgang.thaller@gmx.net
Thu, 7 Mar 2002 17:21:24 +0100
>[...] appears to scale the line by 2, [...]
>When compiling Lines.hs with -O, I get
>
>/tmp/ghc14725.hc: In function `s8Wy_ret':
>/tmp/ghc14725.hc:474: warning: implicit declaration of function `glScalef'
Compilation with -O makes GHC compile via the C compiler. GHC should
have been told
to #include <GL/gl.h> in that case, but at least for Lines.hs, it
didn't do so properly.
Make sure that an option like '-#include <GL/gl.h>' (glu.h or glut.h
should be fine, too)
gets passed to the compiler or that there is an {-# OPTIONS -#include
... #-} line at the
top of that file.
If the C compiler calls a function that expects a float argument
without having the proper
declaration, it passes a double instead, which is Not Good(tm).
Not exactly a solution, but it should explain the problem...
Wolfgang