The build for the MesaGLUT libraries is missing the Fortran callbacks, which results in unresolved references for __glutSetFCB and __glutGetFCB when using the f90gl Fortran interface to Mesa and GLUT. This is a very simple bug -- it is just that the Fortran callback source file was omitted in the Makefile. You just need to edit src/glut/glx/Makefile and add glut_fbc.c to the definition of SOURCES. This is Mesa version 7.0.1.
Who calls __glutSetFCB and __glutGetFCB? The application? gcc issues a lot of warnings when compiling this file: glut_fbc.c: In function ‘__glutSetFCB’: glut_fbc.c:27: warning: ISO C forbids conversion of object pointer to function pointer type glut_fbc.c:30: warning: ISO C forbids conversion of object pointer to function pointer type etc. If we changed the parameter (and return type) of those functions to GLUTproc it would silence the errors, but I don't know that'd effect the Fortran ABI. Any ideas?
__glutSetFCB and __glutGetFCB are called by f90gl. The use of the Set function is (for example): void APIENTRY fglutDisplayFunc(GLUTdisplayFCBUSR display) { __glutSetFCB(GLUT_TMP_DISPLAY,(void *)display); glutDisplayFunc(fortranDisplayWrapper); } and the use of the Get function is: void GLUTCALLBACK fortranDisplayWrapper(void) { ((GLUTdisplayFCBUSR)__glutGetFCB(GLUT_TMP_DISPLAY))(); } If that doesn't tell you enough about whether the change is safe, I can fill in more of the details, or you can look at the source in cwrapglt.c in the f90gl distribution at http://math.nist.gov/f90gl
commit 39fc89a24e778f3ff6d92e8513b652a6c598370e Author: Brian <brian.paul@tungstengraphics.com> Date: Wed Sep 12 13:40:15 2007 -0600 Add glut_fcb.c to the build and update to fix warnings (see bug 12405)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.