From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23305 invoked by alias); 20 Jul 2005 17:32:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 23272 invoked by uid 22791); 20 Jul 2005 17:32:42 -0000 Received: from mx1.amrdec.army.mil (HELO mx1.amrdec.army.mil) (199.209.144.30) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Wed, 20 Jul 2005 17:32:42 +0000 Received: from RD-Bridge.ds.amrdec.army.mil ([10.0.60.29]) by mx1.amrdec.army.mil (SMSSMTP 4.1.4.30) with SMTP id M2005072012324002514 for ; Wed, 20 Jul 2005 12:32:40 -0500 Received: from AMR-EX6.ds.amrdec.army.mil ([10.0.60.16]) by RD-Bridge.ds.amrdec.army.mil with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 Jul 2005 12:32:40 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: g++ problem when attempting to cast a function pointer in an OpenGL GLU callback Date: Wed, 20 Jul 2005 17:58:00 -0000 Message-ID: <1075213EFAF9BA4181A250B072635947F14C8A@AMR-EX6.ds.amrdec.army.mil> From: "Day, Michael A AMRDEC/UAH" To: X-SW-Source: 2005-07/txt/msg00926.txt.bz2 I've got a program I'm attempting to port from Red Hat Enterprise Linux 3 t= o Cygwin (on Windows). =20 g++ -v in Cygwin reveals: gcc version 3.4.4 g++ -v in Red Hat reveals: gcc version 3.2.3-52 =20 There's the background. Here's the problem: =20 I'm attempting to cast a function pointer in the following C++ code: =20 ------------------------------------------ /* ... includes and what not ... */ =20 void tcbBegin(GLenum prim) {=20 cout << "BEGIN";=20 } =20 /* ... */ =20 void tessellateTest() { //Allocate a new GLU tessellation object GLUtesselator *tess =3D gluNewTess(); =20 //Assigning callbacks =20 //begin callback gluTessCallback(tess,GLU_TESS_BEGIN, (void(*)()) tcbBegin); // THIS IS = LINE 71 // =20 /* ... */ -------------------------------------- =20 When compiling, this error happens in Cygwin: test.cpp:72: error: invalid conversion from `void (*)()' to `void (*)()' =20 No error occurs in Red Hat. The cast works just fine, and I've used this c= ode with no problem for several months. =20 Not casting at all results in this error (on both Red Hat and Cygwin): test.cpp:71: error: invalid conversion from `void (*)(GLenum)' to `void (*)= ()' =20 My compile line in Cygwin looks like: $ g++ test.cpp -lglu32 -lopengl32 =20 And in Red Hat it looks like: $ g++ test.cpp -lGLU -lGL Any idea whats going on? It seems to me that the cast should be legal. Ha= ve the rules changed in g++ between the two versions? I have already tried = using a reinterpret_cast, but that didn't work. =20 Thanks, =20 Mike Day Virtual Targets Center https://modelexchange.army.mil/ =20 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/