I am banging my head against a wall right now. This must be the 5th day that I read everything up to chapter 2 in the redbook, tried to get example 1-2 (the hello world example) to work, failed and searched the internet for hours. Your help will be greatly appreciated.
I’m using ubuntu11.10 as OS. I have done a ‘sudo apt-get install’ of almost anything I found in forums and since I don’t get any complaints anymore about missing libraries. I think everything is installed.
In the header I include: #include <GL/gl.h> #include <GL/glu.h>
As I understand the redbook I don’t need to include freeglut.h, glx.h, X11.lib, etc., but I have tried all of them.
I compile like:
gcc -lGL -lGLU -lglut hello.c
I have tried every other combination of flags I could find on the forums, but it still doesn’t work it just gives me different error messages.
Does anyone have openGL working in ubuntu11.10. How do you do this?
That works. My error was simply that I had the flags in front of the file I wanted to compile. I just got lost with all the different combinations of includes and flags I have seen and never even checked whether the position of the flags mattered.