I tried to install OpenGL libraries for ubuntu by following this tutorial -> http://kiwwito.com/installing-opengl-glut-libraries-in-ubuntu/ but when I try to run a program the example program I get this error message.
test2.c:(.text+0x1d): undefined reference to `glClearColor'
test2.c:(.text+0x27): undefined reference to `glClear'
test2.c:(.text+0x2c): undefined reference to `glFlush'
/tmp/ccNGbmFL.o: In function `main':
test2.c:(.text+0x50): undefined reference to `glutInit'
test2.c:(.text+0x5a): undefined reference to `glutInitDisplayMode'
test2.c:(.text+0x69): undefined reference to `glutInitWindowPosition'
test2.c:(.text+0x78): undefined reference to `glutInitWindowSize'
test2.c:(.text+0x82): undefined reference to `glutCreateWindow'
test2.c:(.text+0x8c): undefined reference to `glutDisplayFunc'
test2.c:(.text+0x91): undefined reference to `glutMainLoop'
When I remove those function and leave only #include <GL/glut.h>
the program works fine. I have also tried this http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/#Building_on_Linux installation guide but it doesn't work too. Also I have tried to install eclipse and add those libraries in C++ linker. Eclipse console output was:
16:02:45 **** Incremental Build of configuration Debug for project opengl_glut ****
make all
Building file: ../main.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: opengl_glut
Invoking: Cross G++ Linker
g++ -o "opengl_glut" ./main.o -lglut -lGL -lm -lXrandr -lXi -lX11 -lXxf86vm -lpthread -lglfw3 -lGLU
/usr/bin/ld: cannot find -lglfw3
makefile:44: recipe for target 'opengl_glut' failed
collect2: error: ld returned 1 exit status
make: *** [opengl_glut] Error 1
How to fix those errors?