This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OpenGL and Cygwin

suresh at research dot att dot com wrote:

Hi Brian, Andre, cygwin folks,
   Thanks for all your help to date. I have been somewhat lax in replying
since I am sitting at my laptop in India with a slow connection. Here is
the situation:

As per Andre's suggestion, I wanted to force linking via the windows gl
headers, and so I just moved the /usr/include/GL/* headers out of the
way, and am using the headers from /usr/include/w32api/GL

My g++ command line is

g++ -mno-cygwin .... -lglut32 -lglu32 -lopengl32

and a cygcheck on my exe file indicated that the glut file being linked
is my local copy that I got from nvidia,

Can you tell us why you are using GLUT from NVDIA instead of GLUT from Cygwin's OpenGL package?

and the glu,opengl32 libs are
the dll files linked from c/windows/system32

As I mentioned, all of opengl1.1 works fine. In an attempt to get
histograms, I enabled GL_VERSION_1.2 (I may have the spelling wrong here,
but I used the correct #define). However, the way the windows gl files
are structured, if the _WIN32 option is defined, the GL_VERSION_1_2
option is ignored (i.e the GL_VERSION stuff is only included inside a
#ifndef _WIN32 bracket).

Instead, I enabled GL_GLEXT_PROTOTYPES and that seemed to let the
compilation go thru ok. However, at the link phase, I got stuck, with an
error message of the form

undefined reference to _glGetMinmax@2

the @2 suggesting that at least I am using the right include files.

OpenGL 1.2 and up functions have to be loaded dynamically on the Windows platform, whether you are using Cygwin or not. Your code cannot simply call glGetMinmax; your code needs to load that function first. No fancy linking option or library or dll, from NVDIA or someone else, can avoid that.

This is a common problem for OpenGL programmers on the Windows platform, and it is not related to Cygwin. I suggest that you look in some OpenGL forum to learn how to do that, such as:

If dynamic loading sounds to much trouble, I suggest that you look at extgl, a library that makes programming OpenGL 1.2+ applications on the Windows platform easier:

Now, i have been poking around with the nvidia opengl libs: the one I
have doesn't appear to be the right kind though: (nvoglnt.dll) - I
couldn't link it using -lnvoglnt (ld crashed)

You cannot link with that dll.

This is my current state. I am trying to download the new nvidia drivers
that were released Oct 23, but it is taking some time given my slow

André Bleau, Cygwin's OpenGL package maintainer.

Please address all questions and problem reports about Cygwin's OpenGL package to .

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]