X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <BLU149-W613956508FB9127897128E932D0@phx.gbl> From: =?iso-8859-1?B?QW5kcukgQmxlYXU=?= <andre_bleau AT hotmail DOT com> To: <cygwin AT cygwin DOT com> Subject: Re: Glut Problem Date: Wed, 8 Dec 2010 12:33:42 -0500 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Klaus Ramst=F6ck wrote: =20 > Dear list, =20 Hi Klaus, =20 >=20 > I tried to compile f90gl under a current cygwin. With some grey hair, I > succeded, but my programs dont start.=20 =20 "Dont start". What does that mean? Your programs crash? You get an error me= ssage? Please be more explicit. =20 > I analysed the problem an can > reproduce it with this modified example glut program. > >From /usr/share/doc/opengl-1.1.0/GLUTexamples/helloGlut.c: > ----cut > #include <stdio.h> > #include <GL/glut.h> > #include <GL/glutf90.h> =20 What is glutf90.h ? It is not part of the OpenGL package. =20 >=20 > ... >=20 > #define GLUTCALLBACKFCB > typedef void (GLUTCALLBACKFCB *GLUTbuttonBoxFCBUSR) (int *, int *); > int main(int argc, char* argv[]) > { > atexit(exit_func); > glutInit(&argc, argv); > glutCreateWindow("Hello GLUT!"); > glutDisplayFunc(display_func); > glutKeyboardFunc(keyboard_func); > printf("Press any key to toggle color.\n"); > printf("Press Esc to end.\n"); > glutMainLoop(); =20 glutMainLoop loops forever (up to program exit). Code after it will never g= et executed. > int button, state; > ((GLUTbuttonBoxFCBUSR)__glutGetFCB(GLUT_FCB_BUTTON_BOX))(&button, &state= ); =20 These 2 lines are total nonsense. FCB stands for Fortran CallBack. =20 - Fortran is unsupported by the OpenGL package. I am not interrested in add= ing that support,=20 but I would accept patches that do. =20 - Even if it was supported, you cannot blindly insert a call to a Fortran f= unction into a C function. =20 - glutGetFCB is called to know the function associated with some callback, = in the case above, the callback for the button box. You try to call the callback function di= rectly, but you have not set such a callback function previously (in C, with glutButtonBoxFunc, in= Fortran, presumably with glutSetFCB). =20 - I don't think that button boxes are supported on Windows. They were some = Silicon Graphics things. =20 - Calling things begining by __glut makes no sense. The functions names in = the Glut library begin by glut. The linker is responsible for finding the internal name of the c= orresponding function. > return 0; > } > ----cut =20 > The only relevant difference is this line: > ((GLUTbuttonBoxFCBUSR)__glutGetFCB(GLUT_FCB_BUTTON_BOX))(&button, &state) >=20 > Without this line, the program compiles and works as expected. > It seems there is a mismatch between the definition of __glutGetFCB > in the .a and in the .dll file. =20 I think your problem is deeper than that. You need to explain what you are = trying to do. If you are trying to port some Fortran program that was meant to run on Silicon Gr= aphics to Windows=20 you will have a hard time. =20 >=20 > Can anybody confirm this and help me fix it? >=20 > Thank you. >=20 > Klaus =20 Andr=E9 Bleau, Cygwin's OpenGL package maintainer. Please send any question or comment about the OpenGL package to cygwin at c= ygwin dot com,=20 not directly to me. =20=20=09=09=20=09=20=20=20=09=09=20=20 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple