Building opengl applications

Andre Bleau bleau@igb.umontreal.ca
Mon Jan 20 18:09:00 GMT 2003


Mikael Åsberg wrote:
>Hello, I am trying to build a simple OpenGL program (an example taken from
>the famous "Red Book"). However, during the build process the following
>error messages are displayed:
>
>/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0xe):test.c:
>undefined reference to `glEnableClientState@4'
>/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x1d):test.c:
>undefined reference to `glEnableClientState@4'
>/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x44):test.c:
>undefined reference to `glVertexPointer@16'
>/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x6b):test.c:
>undefined reference to `glColorPointer@16'
>/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x92):test.c:
>undefined reference to `glInterleavedArrays@12'

Messages like that may be an indication that you are using the wrong header 
files or the wrong librairies. You should use the headers from 
/usr/include/GL. They should have lines near the top that say:

** Modified to provide correct APIENTRY and WINGDIAPI definitions
** for Cygwin and Mingw

>Actually, there is more, but each error is an undefined reference so it
>seems gcc cannot find
>the libraries. I did install them, though.
>Building with -glut32 -lglu32 -lopengl32

It's -lglut32. Be sure to put -lglut32 -lglu32 -lopengl32 on the linking 
line _after_ any files that require them.


>What am I doing wrong?
>
>Hope you can help me =)
>
>// Mikael


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@cygwin.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/



More information about the Cygwin mailing list