I've just started using Linux (Mint 11), and recently, I decided to take up OpenGL programming as a hobby. I'm finding the code and techniques relatively simple enough, however, I'm having a hard time trying to get all the resources in the right place. The code is:
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
static int make_resources(void)
{
return 1;
}
static void update_fade_factor(void)
{
}
static void render(void)
{
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutInitWindowSize(400, 300);
glutCreateWindow("Hello World");
glutDisplayFunc(&render);
glutIdleFunc(&update_fade_factor);
glewInit();
if (!GLEW_VERSION_2_0) {
fprintf(stderr, "OpenGL 2.0 not available\n");
return 1;
}
if (!make_resources()) {
fprintf(stderr, "Failed to load resources\n");
return 1;
}
glutMainLoop();
return 0;
}
When I compile, I get the following messages
../../Libraries/glut-3.7/lib/glut/libglut.so||undefined reference to `glXQueryChannelRectSGIX'|
../../Libraries/glut-3.7/lib/glut/libglut.so||undefined reference to `glXChannelRectSyncSGIX'|
../../Libraries/glut-3.7/lib/glut/libglut.so||undefined reference to `glXChannelRectSGIX'|
../../Libraries/glut-3.7/lib/glut/libglut.so||undefined reference to `glXQueryChannelDeltasSGIX'|
../../Libraries/glut-3.7/lib/glut/libglut.so||undefined reference to `glXBindChannelToWindowSGIX'|
||=== Build finished: 5 errors, 0 warnings ===|
Looking online told me that I'm probably not including the right libraries (presumably libX), however I'm unsure of where I can find them, If they're even the right ones to use. I've already tried linking /usr/lib/X86_64-linux-gnu/libX11.so, /usr/lib/X11 contains neither library files nor a /lib directory, and I'm certain that the lib11-dev package is installed. What am I doing wrong?
INFO:
OS: Linux Mint 11
IDE: Code::blocks 10.05
Following this tutorial. Note: I cannot find the x11r6 directories it refers to.