From: goble AT gtech (David. E. Goble) Newsgroups: comp.os.msdos.djgpp Subject: help: trying to run compiled opengl programs, but crash... Date: Sat, 24 Feb 2001 08:16:16 GMT Sender: goble AT kin DOT on DOT net (David. E. Goble) Organization: Gtech.Computing Message-ID: <3a976ae1.1471236@news.adelaide.on.net> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 203.48.5.227 X-Trace: 24 Feb 2001 18:45:12 +1050, 203.48.5.227 Lines: 72 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi all; Iam trying to run a program (on a friends adm system) that I have compiled (see source below). This program works on my 486 and my 686 cyrix(?). The problem is that it crashes with the following; SAMPLE caused an invalid page fault in module at 0000:00000015. Registers: EAX=00401070 CS=0137 EIP=00000015 EFLGS=00010202 EBX=00530000 SS=013f ESP=0063fe2c EBP=0063ff78 ECX=68ff6300 DS=013f ESI=8172342c FS=36f7 EDX=bffbfa30 ES=013f EDI=8172181c GS=0000 Bytes at CS:EIP: ff 00 f0 08 80 00 f0 6f ef 00 f0 00 00 00 d0 28 Stack dump: 0063fe30 0000013f 0040100a 00402000 bff88e93 8172181c 8172342c 00530000 706d6153 4500656c 81004558 00530000 504d4153 5800454c 00000045 00000000 ########## source code ########### // soure code compiled with; // gccw32 -o cube cube.cpp -lglt32 -lgl32 -lglu32 #include #include #include #include void init(void) { glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel (GL_FLAT); } void display(void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 1.0, 1.0); glLoadIdentity (); /* clear the matrix */ /* viewing transformation */ gluLookAt (5.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glScalef (2.0, 2.0, 1.0); /* modeling transformation */ glutWireCube (1.0); glFlush (); } void reshape (int w, int h) { glViewport (0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode (GL_PROJECTION); glLoadIdentity (); glFrustum (-1.0, 1.0, -1.0, 1.0, 5., 40.0); //gluPerspective( 10.0, 1.0, 0.001, 100.0); glMatrixMode (GL_MODELVIEW); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow ("cube"); init (); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0; }