Hi, I'm trying to port OpenInventor code and using the new opengl-1.1.0 and I am getting undefined _glXMakeCurrent symbols:
/usr/bin/CC -g Main.o ClassDef.o Man.o Reader.o Writer.o BuildIssues.o -lInventor -lstdc++ -L/usr/X11R6/lib -L/usr/local/lib -limage -ljpeg -liconv -lFL -lfreetype -lglu32 -lopengl32 -lXm -lXt -lXext -lXi -lX11 -lm -o ivman /usr/local/lib/libInventor.a(So.o): In function `_ZN19SoOffscreenRendererD2Ev': /usr/local/src/inventor2/lib/database/src/so/SoOffscreenRenderer.c++:173: undefined reference to `_glXDestroyGLXPixmap' /usr/local/src/inventor2/lib/database/src/so/SoOffscreenRenderer.c++:174: undefined reference to `_glXDestroyContext' /usr/local/src/inventor2/lib/database/src/so/SoOffscreenRenderer.c++:755: undefined reference to `_glXMakeCurrent' ... I could see it in: [EMAIL PROTECTED] ...inventor2/lib]$ nm /usr/X11R6/lib/libGL-1.dll.a |grep glXMakeCurrent 00000000 I __imp__glXMakeCurrentReadSGI 00000000 T _glXMakeCurrentReadSGI 00000000 I __imp__glXMakeCurrent 00000000 T _glXMakeCurrent What library in the new opengl-1.1.0 can I used to fix this problem? Thank you, Linh -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Phan, Linh H Sent: Monday, December 08, 2008 6:25 PM To: cygwin-xfree@cygwin.com Subject: RE: OpenGL-1.1.0 compile problem in cygwin-1.7 Hi Brian, Can you show me how I can fix the cast? I tried this: #include <GL/gl.h> #include <GL/glu.h> void test (void) { GLUtesselator *tobj = (GLUtesselator *)gluNewTess(); gluTessCallback(tobj, (GLenum)GLU_BEGIN, (void (*)())glBegin); gluTessCallback(tobj, (GLenum)GLU_END, glEnd); gluTessCallback(tobj, (GLenum)GLU_VERTEX, (void (*)())glVertex2fv); } And that fixed it for glEnd, but I don't know how to fix the glBegin and glVertex2fv. This is not my code; it's part of the SGI OpenInventor library. Thank you, Linh -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Dessent Sent: Monday, December 08, 2008 6:05 PM To: cygwin-xfree@cygwin.com Subject: Re: OpenGL-1.1.0 compile problem in cygwin-1.7 "Phan, Linh H" wrote: > $ /usr/bin/g++ -g -c -I/usr/include/opengl test.c++ > x.c++: In function `void test()': > x.c++:7: error: invalid conversion from `void (*)()' to `void (*)()' > x.c++:7: error: initializing argument 3 of `void > gluTessCallback(GLUtesselator*, GLenum, void (*)())' > x.c++:8: error: invalid conversion from `void (*)()' to `void (*)()' > x.c++:8: error: initializing argument 3 of `void > gluTessCallback(GLUtesselator*, GLenum, void (*)())' > x.c++:9: error: invalid conversion from `void (*)()' to `void (*)()' > x.c++:9: error: initializing argument 3 of `void > gluTessCallback(GLUtesselator*, GLenum, void (*)())' Here you are using the Win32 API version of these functions, and the Win32 API generally uses the stdcall calling convention throughout, including the callback. C++ is very strict about types and it does not consider "pointer to function taking no args and returning void using cdecl calling convention" and "pointer to function taking no args and returning void using stdcall calling convention" to be compatible types. It's just that the diagnostic doesn't display the calling convention attribute of the type, so it only looks like they're the same type from the message. Moreover, the compiler is right to be picky because calling convention is a fundamental aspect of the function -- it's not something that can be fixed by just changing to the correct cast. In this case since glBegin et al. are also Win32 API functions they have the proper calling convention, so you only need to fix the cast. But if you were actually implementing the callback in your code, you would have to both explicitly ensure that it was is defined with the correct calling convention, in addition to using the proper cast. > But I can compile it if I use the /usr/X11R6/include/GL: > > $ /usr/bin/g++ -g -c -I/usr/X11R6/include test.c++ > $ Here you're using the X11 version of the API, which uses the default cdecl calling convention throughout. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/