This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: A problem with glut in cygwin
- From: Andre Bleau <bleau at igb dot umontreal dot ca>
- To: cygwin at cygwin dot com
- Date: Wed, 04 Jun 2003 10:44:51 -0400
- Subject: Re: A problem with glut in cygwin
Amikam Liss <amikaml at netvision dot net dot il> wrote:
Hi, I have a problem with glut, I will be happy if someone can help me:
I have Windows98, I installed cygwin yesterday.
I wrote a small progam in OpenGL using glut.
I compiled the program with this command: (the program - triangle.c)
gcc triangle.c -o triangle -lOpenGL32 -lGLU32 -lglut32 (I linked with the
libraries of windows)
The correct order is (as written in /usr/doc/opengl-1.1.0/README.txt):
-lglut32 -lglu32 -lopengl32
Now when I run the executable triangle.exe, the program is running ok (a
rotated trinagle), but when I close the
window, the programm hangs, the file triangle.exe doesn't finish to run.
This is the call stack:
...
Cannot access memory at address 0x83941fec
The main function:
int main(int argc,char *argv[])
{
glutInit(&argc,argv);
glInit();
glutMainLoop();
return 0;
}
Your main is wrong. A minimalist GLUT program is:
-----------------------------------------------------------------------------#include
<GL/glut.h>
void display_func()
{
/* Do some drawing here */
}
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutCreateWindow("Hello GLUT!");
glutDisplayFunc(display_func);
glutMainLoop();
return 0;
}
-----------------------------------------------------------------------------
What I can do to solve the problem?
Thank you
Amikam Liss
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
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/