Reputation: 331
I am trying to static compile an opengl program using gl3w but i am getting the following errors on doing g++ -Wall -o Code Code.cpp --static -ldl -lc -lglut -lGL -lGLU
Code.cpp: In function ‘void drawScene()’:
Code.cpp:148:15: error: ‘GL_MODELVIEW’ was not declared in this scope
Code.cpp:148:27: error: ‘glMatrixMode’ was not declared in this scope
Code.cpp:149:17: error: ‘glLoadIdentity’ was not declared in this scope
Code.cpp:150:15: error: ‘glPushMatrix’ was not declared in this scope
Code.cpp:155:32: error: ‘glTranslatef’ was not declared in this scope
Code.cpp:156:27: error: ‘glScalef’ was not declared in this scope
Code.cpp:157:28: error: ‘glColor3f’ was not declared in this scope
Code.cpp:167:34: error: ‘glRasterPos3f’ was not declared in this scope
Code.cpp:172:15: error: ‘glPopMatrix’ was not declared in this scope
Code.cpp:210:19: error: ‘glBegin’ was not declared in this scope
Code.cpp:211:29: error: ‘glVertex3f’ was not declared in this scope
Code.cpp:215:9: error: ‘glEnd’ was not declared in this scope
Code.cpp:216:15: error: ‘glPopMatrix’ was not declared in this scope
Code.cpp:236:35: error: ‘glRotatef’ was not declared in this scope
Code.cpp:238:37: error: ‘glColor4f’ was not declared in this scope
Code.cpp:242:14: error: ‘glPopMatrix’ was not declared in this scope
Code.cpp:249:34: error: ‘glColor4f’ was not declared in this scope
Code.cpp:253:18: error: ‘glBegin’ was not declared in this scope
Code.cpp:254:29: error: ‘glVertex3f’ was not declared in this scope
Code.cpp:260:33: error: ‘glColor4f’ was not declared in this scope
Code.cpp:274:8: error: ‘glEnd’ was not declared in this scope
Code.cpp:282:34: error: ‘glColor4f’ was not declared in this scope
Code.cpp:299:34: error: ‘glColor4f’ was not declared in this scope
Code.cpp:323:19: error: ‘glVertex2f’ was not declared in this scope
Code.cpp: In function ‘void drawBox(float)’:
Code.cpp:693:18: error: ‘glBegin’ was not declared in this scope
Code.cpp:694:31: error: ‘glVertex2f’ was not declared in this scope
Code.cpp:698:8: error: ‘glEnd’ was not declared in this scope
Code.cpp:702:37: error: ‘glVertex3f’ was not declared in this scope
Code.cpp: In function ‘void drawLaser(int)’:
Code.cpp:713:28: error: ‘glColor3f’ was not declared in this scope
Code.cpp:714:18: error: ‘glBegin’ was not declared in this scope
Code.cpp:715:30: error: ‘glVertex2f’ was not declared in this scope
Code.cpp:717:8: error: ‘glEnd’ was not declared in this scope
Code.cpp: In function ‘void drawCannon()’:
Code.cpp:723:18: error: ‘glBegin’ was not declared in this scope
Code.cpp:725:30: error: ‘glVertex3f’ was not declared in this scope
Code.cpp:730:8: error: ‘glEnd’ was not declared in this scope
Code.cpp:746:28: error: ‘glColor3f’ was not declared in this scope
Code.cpp: In function ‘void drawSpider(float)’:
Code.cpp:776:25: error: ‘glBegin’ was not declared in this scope
Code.cpp:778:58: error: ‘glVertex2f’ was not declared in this scope
Code.cpp:780:8: error: ‘glEnd’ was not declared in this scope
Code.cpp:784:30: error: ‘glVertex3f’ was not declared in this scope
Code.cpp: In function ‘void initRendering()’:
Code.cpp:822:11: error: ‘GL_COLOR_MATERIAL’ was not declared in this scope
Code.cpp: In function ‘void handleResize(int, int)’:
Code.cpp:830:15: error: ‘GL_PROJECTION’ was not declared in this scope
Code.cpp:830:28: error: ‘glMatrixMode’ was not declared in this scope
Code.cpp:831:17: error: ‘glLoadIdentity’ was not declared in this scope
Code.cpp:833:15: error: ‘GL_MODELVIEW’ was not declared in this scope
Code.cpp: In function ‘void GetOGLPos(int, int)’:
Code.cpp:940:16: error: ‘GL_MODELVIEW_MATRIX’ was not declared in this scope
Code.cpp:941:16: error: ‘GL_PROJECTION_MATRIX’ was not declared in this scope
i have included #include "GL/gl3w.h" before #include "GL/glut.h" and also added gl3w.h to /usr/include/GL/ folder. Is their something wrong i am doing ?
Upvotes: 0
Views: 2231
Reputation:
The functions you're trying to use (e.g, glBegin()
, glVertex…()
, etc) are part of the OpenGL compatibility profile. They are not present in the OpenGL core profile, which is what gl3w provides.
It sounds like this may not be what you actually want here. If so, don't use gl3w.
Upvotes: 2