OpenGL linking problems

André Bleau andre_bleau@hotmail.com
Sat Sep 4 16:29:00 GMT 2010



David Doria wrote:
 
> I'm trying to build a library (VTK) in Cygwin. I am getting a lot of
> errors like this
> 
> undefined reference to `_glDepthMask'
> undefined reference to?`_glGetIntegerv'
> undefined reference to?`_glMatrixMode'
> 
> I installed ALL of the cygwin packages to try to avoid problems like
> this. I also added
> 
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
> 
> to my ~/.bash_profile
> 
> Anyone know how to get something to link against OpenGL in cygwin?
 
Well, we need more info to help us help you. What kind of application are you trying to build? X11 or native? There are 2 ways to build OpenGL-related programs:
 
1- Using native OpenGL, with driver supported hardware acceleration. For that, you need some way to 
get a graphic device context. One portable way to do that is to use the GLUT library, provided by 
the opengl package that I maintain. Look at the doc in /usr/share/doc/opengl-1.1.0 to learn how to 
do that.
 
The OpenGL implementation in that case is provided by Window's opengl32.dll. Cygwin's w32api package 
provides the headers and link library for that version of OpenGL.
 
LD_LIBRARY_PATH has no effect if you go that way.
 
2- Using X11, which provides an opengl implementation. At one point, there was support for hardware 
acceleration; then, it went away; I don't know if it came back or if it is coming back "soon". I will let the maintainer of the libGL* packages answer questions you may have about it. You would better send them to cygwin-xfree at cygwin dot com .
 
> 
> Thanks,
> 
> David
> 
 
- André Bleau, Cygwin's opengl package maintainer.

Please send any question or comment about the opengl package to cygwin at cygwin dot com,
not directly to me.
  		 	   		  

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list