codeblocks and opengl


i am new to openframeworks and C. I am trying to compile some code i have done with OpenGL that works fine on windows. The error says “undefined reference to ‘glEnable’” and so on for each GL command. So it looks like it does not find GLUT/GL/GLU libraries.

i have been making sure i have all dev packages needed for opengl so i am not sure why it is not finding the headers and libraries. not sure if i am missing something or i need to configure tell the system where to find them.

thanks for any tip…


i forgot to say i am on ubuntu hardy with codeblocks from svn and latest openframeworks 0.05


looks like i am the champion answering myself. always find the solutions a minute after asking the question… i did create new project > GLUT project, entered /usr directory and Codeblocks finds all the required libraries. great.

still it would be nice if someone would explain what is actually being set by doing that.



OpenGL should work fine in a regular OF codeblocks project.
Did you use one of the existing OF projects? The emptyExample project in the examples is a good general project to copy and use.

You shouldn’t need to create a GLUT project using the codeblocks wizard. Just copy and use an existing OF project. Use the wizard for apps not dependent on OF.

Otherwise, a general problem in converting OpenGL apps to Linux from windows is the include path. Windows is case insensitive, while Linux is case sensitive.
So this would work in Windows but not in Linux for example:
#include <gl/glu.h>

It would have to be
#include <GL/glu.h>

no. i was just opening up a file with some OpenGL code. thanks for the tips