I have found this code and wanted to try on my machine :
#include <GL/freeglut.h>
static void RenderSceneCB()
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
static void InitializeGlutCallbacks()
{
glutDisplayFunc(RenderSceneCB);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA);
glutInitWindowSize(1024, 768);
glutInitWindowPosition(100, 100);
glutCreateWindow("Tutorial 01");
InitializeGlutCallbacks();
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glutMainLoop();
return 0;
}
And I got these errors :
g++ tutorial01.cpp
/tmp/ccOoXvqJ.o: In function `RenderSceneCB()':
tutorial01.cpp:(.text+0xa): undefined reference to `glClear'
tutorial01.cpp:(.text+0xf): undefined reference to `glutSwapBuffers'
/tmp/ccOoXvqJ.o: In function `InitializeGlutCallbacks()':
tutorial01.cpp:(.text+0x1f): undefined reference to `glutDisplayFunc'
/tmp/ccOoXvqJ.o: In function `main': tutorial01.cpp:(.text+0x43):
undefined reference to `glutInit' tutorial01.cpp:(.text+0x4d):
undefined reference to `glutInitDisplayMode'
tutorial01.cpp:(.text+0x5c): undefined reference to
`glutInitWindowSize' tutorial01.cpp:(.text+0x6b): undefined reference
to `glutInitWindowPosition' tutorial01.cpp:(.text+0x75): undefined
reference to `glutCreateWindow' tutorial01.cpp:(.text+0x8b): undefined
reference to `glClearColor' tutorial01.cpp:(.text+0x90): undefined
reference to `glutMainLoop' collect2: ld returned 1 exit status
I think I have successfully installed freeglut3-dev on my machine. Can you tell me why I'm getting so many errors? I'm using Ubuntu 12.04.