I am trying to run the following program on ubuntu 15.04. However on typing "g++ pgm1.cpp -lglut" I am getting following errors
/usr/bin/ld: /tmp/cc9aXqhZ.o: undefined reference to symbol 'glClear'
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
Though I am familiar with C programming in Codeblocks and DevC++, this is the first time I am working on Ubuntu and OpenGL. I installed ubuntu and files related to OpenGL based on information available on the net. The sample program too is from the internet. I would request help in getting the program run. Thanks.
# include "GL/freeglut.h"
# include "GL/gl.h"
# include <GL/glut.h>
void init(void)
{
glClearColor(0.0f,0.0f,1.0f,1.0f);
}
void display (void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
int main (int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("A Blank Window");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
ldconfig
2. how did you compile your code? what arguments are you using? $\endgroup$sudo ldconfig
. When you see Permission denied. adding sudo to the command will fix that 99% of the time(not the best habit though) $\endgroup$