PDA

View Full Version : Multiple errors with openGl



Darkness3477
March 11th, 2007, 10:51 AM
Hi, I was looking into openGL program for a bit of fun, and found the following site http://ubuntu-gamedev.wikispaces.com/How-To+Setup+SDL+for+games+development
and proceeded to apt-get everything and then testing.

I ran the test SDl test program, nothing came up (No errors or anything else, which is what's supposed to happen (I think)) and moved on to downloading the openGL Gears test. I downloaded it, ran ./configure, nothing came up. Then went make and these erros appeared

maver@maver-laptop:~/Desktop/game$ make
gcc -DPACKAGE=\"SDLgears\" -DVERSION=\"1.0.2\" -I. -I. -g -O2 -I/usr/include/SDL -D_REENTRANT -c gears.c
gears.c:39:21: error: GL/glut.h: No such file or directory
gears.c:45: error: syntax error before ‘T0’
gears.c:45: warning: data definition has no type or storage class
gears.c:46: error: syntax error before ‘Frames’
gears.c:46: warning: data definition has no type or storage class
gears.c:63: error: syntax error before ‘inner_radius’
gears.c: In function ‘gear’:
gears.c:66: error: ‘GLint’ undeclared (first use in this function)
gears.c:66: error: (Each undeclared identifier is reported only once
gears.c:66: error: for each function it appears in.)
gears.c:66: error: syntax error before ‘i’
gears.c:67: error: ‘GLfloat’ undeclared (first use in this function)
gears.c:71: error: ‘r0’ undeclared (first use in this function)
gears.c:71: error: ‘inner_radius’ undeclared (first use in this function)
gears.c:72: error: ‘r1’ undeclared (first use in this function)
gears.c:72: error: ‘outer_radius’ undeclared (first use in this function)
gears.c:72: error: ‘tooth_depth’ undeclared (first use in this function)
gears.c:73: error: ‘r2’ undeclared (first use in this function)
gears.c:75: error: ‘da’ undeclared (first use in this function)
gears.c:75: error: ‘teeth’ undeclared (first use in this function)
gears.c:77: error: ‘GL_FLAT’ undeclared (first use in this function)
gears.c:82: error: ‘GL_QUAD_STRIP’ undeclared (first use in this function)
gears.c:83: error: ‘i’ undeclared (first use in this function)
gears.c:84: error: ‘angle’ undeclared (first use in this function)
gears.c:85: error: ‘width’ undeclared (first use in this function)
gears.c:95: error: ‘GL_QUADS’ undeclared (first use in this function)
gears.c:142: error: ‘u’ undeclared (first use in this function)
gears.c:143: error: ‘v’ undeclared (first use in this function)
gears.c:144: error: ‘len’ undeclared (first use in this function)
gears.c:166: error: ‘GL_SMOOTH’ undeclared (first use in this function)
gears.c: At top level:
gears.c:180: error: syntax error before ‘view_rotx’
gears.c:180: warning: data definition has no type or storage class
gears.c:181: error: syntax error before ‘gear1’
gears.c:181: warning: data definition has no type or storage class
gears.c:182: error: syntax error before ‘angle’
gears.c:182: warning: data definition has no type or storage class
gears.c: In function ‘draw’:
gears.c:187: error: ‘GL_COLOR_BUFFER_BIT’ undeclared (first use in this function)
gears.c:187: error: ‘GL_DEPTH_BUFFER_BIT’ undeclared (first use in this function)
gears.c:218: error: ‘GLint’ undeclared (first use in this function)
gears.c:218: error: syntax error before ‘t’
gears.c:219: error: ‘t’ undeclared (first use in this function)
gears.c:220: error: ‘GLfloat’ undeclared (first use in this function)
gears.c:220: error: syntax error before ‘seconds’
gears.c:222: error: ‘seconds’ undeclared (first use in this function)
gears.c:222: error: ‘fps’ undeclared (first use in this function)
gears.c: In function ‘special’:
gears.c:264: error: ‘GLUT_KEY_UP’ undeclared (first use in this function)
gears.c:267: error: ‘GLUT_KEY_DOWN’ undeclared (first use in this function)
gears.c:270: error: ‘GLUT_KEY_LEFT’ undeclared (first use in this function)
gears.c:273: error: ‘GLUT_KEY_RIGHT’ undeclared (first use in this function)
gears.c: In function ‘reshape’:
gears.c:286: error: ‘GLfloat’ undeclared (first use in this function)
gears.c:286: error: syntax error before ‘h’
gears.c:288: error: ‘GLint’ undeclared (first use in this function)
gears.c:288: error: syntax error before ‘width’
gears.c:289: error: ‘GL_PROJECTION’ undeclared (first use in this function)
gears.c:291: error: ‘h’ undeclared (first use in this function)
gears.c:292: error: ‘GL_MODELVIEW’ undeclared (first use in this function)
gears.c: In function ‘init’:
gears.c:300: error: syntax error before ‘pos’
gears.c: At top level:
gears.c:302: error: syntax error before ‘red’
gears.c:303: warning: data definition has no type or storage class
gears.c:304: error: syntax error before ‘green’
gears.c:305: warning: data definition has no type or storage class
gears.c:306: error: syntax error before ‘blue’
gears.c:307: warning: data definition has no type or storage class
gears.c:309: warning: parameter names (without types) in function declaration
gears.c:309: warning: data definition has no type or storage class
gears.c:310: warning: parameter names (without types) in function declaration
gears.c:310: warning: data definition has no type or storage class
gears.c:311: warning: parameter names (without types) in function declaration
gears.c:311: warning: data definition has no type or storage class
gears.c:312: warning: parameter names (without types) in function declaration
gears.c:312: warning: data definition has no type or storage class
gears.c:313: warning: parameter names (without types) in function declaration
gears.c:313: warning: data definition has no type or storage class
gears.c:316: error: initializer element is not constant
gears.c:316: warning: data definition has no type or storage class
gears.c:317: warning: parameter names (without types) in function declaration
gears.c:317: warning: data definition has no type or storage class
gears.c:318: warning: parameter names (without types) in function declaration
gears.c:318: warning: data definition has no type or storage class
gears.c:319: error: syntax error before numeric constant
gears.c:319: error: conflicting types for ‘gear’
gears.c:65: error: previous definition of ‘gear’ was here
gears.c:319: warning: data definition has no type or storage class
gears.c:320: warning: data definition has no type or storage class
gears.c:322: error: initializer element is not constant
gears.c:322: warning: data definition has no type or storage class
gears.c:323: warning: parameter names (without types) in function declaration
gears.c:323: warning: data definition has no type or storage class
gears.c:324: warning: parameter names (without types) in function declaration
gears.c:324: warning: data definition has no type or storage class
gears.c:325: error: syntax error before numeric constant
gears.c:325: warning: data definition has no type or storage class
gears.c:326: warning: data definition has no type or storage class
gears.c:328: error: initializer element is not constant
gears.c:328: warning: data definition has no type or storage class
gears.c:329: warning: parameter names (without types) in function declaration
gears.c:329: warning: data definition has no type or storage class
gears.c:330: warning: parameter names (without types) in function declaration
gears.c:330: warning: data definition has no type or storage class
gears.c:331: error: syntax error before numeric constant
gears.c:331: warning: data definition has no type or storage class
gears.c:332: warning: data definition has no type or storage class
gears.c:334: warning: parameter names (without types) in function declaration
gears.c:334: warning: data definition has no type or storage class
gears.c:336: error: syntax error before ‘if’
gears.c:336: error: syntax error before ‘[’ token
gears.c:336: error: ‘argv’ undeclared here (not in a function)
gears.c:336: error: ‘__s2’ undeclared here (not in a function)
gears.c:336: error: syntax error before ‘if’
gears.c:336: error: non-static declaration of ‘__result’ follows static declaration
gears.c:336: error: previous definition of ‘__result’ was here
gears.c:336: warning: data definition has no type or storage class
gears.c:336: error: syntax error before ‘}’ token
gears.c:336: error: static declaration of ‘__result’ follows non-static declaration
gears.c:336: error: previous declaration of ‘__result’ was here
gears.c:336: error: ‘__s1’ undeclared here (not in a function)
gears.c:336: error: syntax error before ‘if’
gears.c:336: error: non-static declaration of ‘__result’ follows static declaration
gears.c:336: error: previous definition of ‘__result’ was here
gears.c:336: warning: data definition has no type or storage class
gears.c:336: error: syntax error before ‘}’ token
gears.c:338: error: syntax error before string constant
gears.c:338: error: syntax error before ‘)’ token
gears.c:339: error: syntax error before string constant
gears.c:339: error: syntax error before ‘)’ token
gears.c:340: error: syntax error before string constant
gears.c:340: error: syntax error before ‘)’ token
gears.c: In function ‘visible’:
gears.c:347: error: ‘GLUT_VISIBLE’ undeclared (first use in this function)
gears.c: In function ‘main’:
gears.c:356: error: ‘GLUT_RGB’ undeclared (first use in this function)
gears.c:356: error: ‘GLUT_DEPTH’ undeclared (first use in this function)
gears.c:356: error: ‘GLUT_DOUBLE’ undeclared (first use in this function)
make: *** [gears.o] Error 1


However, when I run the program ./SDLgears it works, a screen pops up and some gears spin around. Pretty cool looking.

So, it works (kinda) but I get those errors when going 'make' so I was wondering what I was doing wrong. I probably forgot to download something, but I'm stumped as to what I forgot, so help would be very good.


P.S. Any links to good openGl and SDL tutorials would be much appreciated. I want to learn how to play around with graphicss (Not so much games *just* yet) kinda like the gears example... But not that advanced just yet.

hod139
March 11th, 2007, 04:26 PM
That's an annoying package. The problem is that it builds both the SDL version and the GLUT version. To fix that error you need to install GLUT


sudo aptitude install freeglut3-dev

grusifix
March 11th, 2007, 09:57 PM
That sure is annoying. Why it has build them both? You should check http://nehe.gamedev.net. Quite many of tutorials there have Linux/SDL download option.

Darkness3477
March 12th, 2007, 07:59 AM
That's an annoying package. The problem is that it builds both the SDL version and the GLUT version. To fix that error you need to install GLUT


sudo aptitude install freeglut3-dev


Thank you very much, that fixed it up nicely. I'm quite surprised that the tutorial didn't include that. Now, onto my goal: Making a ball hit the side 'wall' and bounce off at the correct angle.