OpenGL and GLUT packages on Windows cause undefeined reference problem if build theirs myself

shelarcy <[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl,gmane.comp.lang.haskell.libraries
Message-ID <[email protected]>
Hello all,

I tried to build OpenGL and GLUT packages on Windows by myself.
Then runhaskell Setup.hs build cause below problem.

$ runhaskell Setup.hs build
Reading parameters from c:\home\ghc-6.7.20070305\libraries\GLUT\GLUT.buildinfo
Preprocessing library GLUT-2.1...
Building GLUT-2.1...
(snip)
c:\home\ghc-6.7.20070305\ghc-6.7.20070305\bin\ar.exe q dist\build\libHSGLUT-2.1.a dist\build\Graphics\UI\GLUT.o d
(snip)
dist\build\Graphics\UI\GLUT\Callbacks\Registration_stub.o
Warning: resolving _hs_GLUT_getProcAddress@4 by linking to _hs_GLUT_getProcAddress
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups


This problem is already noticed by Pepe Gallardo.
http://www.haskell.org/pipermail/hopengl/2006-December/000680.html

And same problem cause if build GHC head snapshot myself, too.


C:\home\ghc-6.7.20070305\libraries\GLUT\examples\OrangeBook\ogl2brick>C:\home\gh
c-6.7.20070305\ghc-6.7.20070305\bin\ghc.exe --make Brick.hs
[1 of 1] Compiling Main             ( Brick.hs, Brick.o )
Linking Brick.exe ...
C:/home/ghc-6.7.20070305/ghc-6.7.20070305/libHSGLUT.a(Extensions__3.o)(.text+0x1
4):fake: undefined reference to `hs_GLUT_getProcAddress@4'
C:/home/ghc-6.7.20070305/ghc-6.7.20070305/libHSOpenGL.a(Extensions__3.o)(.text+0
x14):fake: undefined reference to `hs_OpenGL_getProcAddress@4'
collect2: ld returned 1 exit status


This problem doesn't occure Sigbjorn Finne's build snapshot ...
http://www.haskell.org/ghc/dist/current/dist/
http://www.haskell.org/pipermail/cvs-ghc/2007-March/034396.html

I don't know why .. but I know why reference is unresolved.

CALLCONV is defined stdcall on Windows, but hs_**_getProcAddress
(and other cbits's c functions) are build with ccall convention.

Attached are darcs patch to fix these problem.
But ... I don't know this patch doesn't cause any ptoblem Sigbjorn's
next binary release. Because I don't know why OpenGL and GLUT can
build correctly under his environment.

Best Regars,

-- 
shelarcy <shelarcy    capella.freemail.ne.jp>
http://page.freett.com/shelarcy/

_______________________________________________
HOpenGL mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hopengl
opengl_fix_getProcAddress.dpatch (application/octet-stream, 3.6 KB) - not displayed
glut_fix_getProcAddress.dpatch (application/octet-stream, 3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.