Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.2.0.9.0.20030318101022.00b1f570@irispavp.igb.umontreal.ca> X-Sender: bleau2 AT irispavp DOT igb DOT umontreal DOT ca (Unverified) Date: Tue, 18 Mar 2003 10:10:57 -0500 To: cygwin AT cygwin DOT com From: Andre Bleau Subject: Re: Header problem with OGL on Cygwin Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed X-MDRemoteIP: 10.52.50.2 X-Return-Path: bleau AT igb DOT umontreal DOT ca X-MDaemon-Deliver-To: cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h2IFEDv24641 Paul M Sargent wrote: >Hi All, > >I'm currently having some problems linking with OpenGL under cygwin. I was >hoping somebody who understands the system might be able to offer some >advice. > >The problem I'm having is that when I try to link my object files together >with "-lglut32 -lglu32 -lopengl32" I get messages stating that there are >"undefined reference"(s) to "_glBegin", amonst other symbols. > >Searching through the archives I've spotted a message stating that this >means I'm compiling with the wrong headers (The symbols should be of the >form _glBegin at 4'). It's at this point that I've lost the thread. My code >contains "#include " and doing a 'find / -name glut.h' only shows >the one file located in /usr/include/GL. Similarly doing the same find for >gl.h gives me one in /usr/include/GL and one in /usr/include/w32api/GL. > >My compile command is "gcc -c " >My link command is "gcc -o -lglut32 -lglu32 >-lopengl32" > >Am I missing something simple? > >Thanks for any help you can provide > >Paul Paul, In the past, 99% of the time such problem occured, people were _not_ linking with arguments in the appropriate order. -lglut32 -lglu32 -lopengl32 must come after all objects on the command line. Please try compiling and linking this test program; copy the following lines to helloGlut.c : /*-------------------------- helloGlut.c start ----------------------------*/ #include void display_func() { glClear(GL_COLOR_BUFFER_BIT); } int main() { glutCreateWindow("Hello GLUT!"); glutDisplayFunc(display_func); glutMainLoop(); return 0; } /*-------------------------- helloGlut.c end------------------------------*/ And compile and link with _the exact_ following lines: gcc -c helloGlut.c gcc -o helloGlut helloGlut.o -lglut32 -lglu32 -lopengl32 If you get any error messages, report them here verbatim and we'll work from there. Also send the ouput of "cygcheck -c" to a file and attach it to your email. André Bleau, Cygwin's OpenGL package maintainer. email: bleau at igb dot umontreal dot ca (Fight SPAM: encode your email-address) Please address all questions and problem reports about Cygwin's OpenGL package to cygwin AT cygwin DOT com . -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/