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

View: New views
4 Messages — Rating Filter:   Alert me  

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

by shelarcy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
HOpenGL@...
http://www.haskell.org/mailman/listinfo/hopengl

opengl_fix_getProcAddress.dpatch (4K) Download Attachment
glut_fix_getProcAddress.dpatch (4K) Download Attachment

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

by Sven Panne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 09 March 2007 07:28, shelarcy wrote:

> [...]
> 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.

Nice analysis of the problem. Your patch looks correct, but I don't have a
clue why Sigbjorn's binary release works. Before I commit these patches I'd
like to understand the current state of affairs in detail, otherwise
the "official" release might get broken. Sigbjorn?

Cheers,
   S.
_______________________________________________
HOpenGL mailing list
HOpenGL@...
http://www.haskell.org/mailman/listinfo/hopengl

Parent Message unknown Re: OpenGL and GLUT packages on Windows cause undefeined reference problem if build theirs myself

by Sven Panne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 13 March 2007 16:35, Sigbjorn Finne wrote:
> Some (early morning & obvious) guesses that might explain
> the difference in behaviour:
>
> - one version is compiled via the NCG, the other via-C
>    (i.e., the latter gets its calling conventions from the header files.)

I think this might it explain it best, so I'll commit those patches.

Thanks,
   S.
_______________________________________________
HOpenGL mailing list
HOpenGL@...
http://www.haskell.org/mailman/listinfo/hopengl

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

by shelarcy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I checked that latest Sigbjorn's snapshot (ghc-6.7.20070314.20070314)
is also works well.
So we're not afraid of any problem on Windows.

Thanks,

On Wed, 14 Mar 2007 00:58:14 +0900, Sven Panne <sven.panne@...> wrote:
>> Some (early morning & obvious) guesses that might explain
>> the difference in behaviour:
>>
>> - one version is compiled via the NCG, the other via-C
>>    (i.e., the latter gets its calling conventions from the header files.)
>
> I think this might it explain it best, so I'll commit those patches.

--
shelarcy <shelarcy    capella.freemail.ne.jp>
http://page.freett.com/shelarcy/
_______________________________________________
HOpenGL mailing list
HOpenGL@...
http://www.haskell.org/mailman/listinfo/hopengl
LightInTheBox - Buy quality products at wholesale price