delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/18/10:14:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
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 <bleau AT igb DOT umontreal DOT ca>
Subject: Re: Header problem with OGL on Cygwin
Mime-Version: 1.0
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h2IFEDv24641

Paul M Sargent <Pauls AT 3dlabs DOT com> 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 <GL/glut.h>" 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 <source file>"
>My link    command is "gcc -o <exe name> <object files> -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 <GL/glut.h>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019