I am working on a client with GL, GLX, and X11 with Ubuntu 11.10. I am getting a linking error, and I can't seem to figure out why. This one peice of code is what causes it, and if I remove it, it works fine.
Main.cpp:
#include <GL/GLX.h>
#include <X11/Xlib.h>
Init(display, window);
OpenGL.hpp:
#include <GL/GLX.h>
#include <X11/Xlib.h>
bool Init(Display *dis, Window win);
OpenGL.cpp
#include "openGL.hpp"
bool Init(Display *dis, Window win)
{
return true;
}
The error I get is: "Undefined reference to 'OpenGL::Init(_XDisplay*, unsigned long)'.
The weirdest part about is that when I remove the dis parameter completely, the error disappears.
I just gave you the crucial parts, if you would like more code to get a background of whats going on then I would be happy to do so. The only thing I have linked in -lGL.