I have a library opengl.lib which contains wrapper functions to all opengl functions. The functions are declared in their own namespace so that the wrapper functions can be named with the same name as the opengl functions. So inside a wrapper function, opengl function is called with ::gl***();
opengl.h:
namespace OpenGL {
void glFunction();
}
opengl.cpp:
void OpenGL::glFunction() {
::glFunction();
}
Now the problem is that when I use this opengl.lib in my application and include my own "opengl.h", for some reason the real opengl functions get called directly and not my wrapper functions.
I have made sure that I have not included any real opengl.h so this must be some kind of linker issue. How can I resolve it? I have also the real opengl library in library path because otherwise I get linker errors in my opengl.lib as it uses the real opengl functions. So the real opengl library and my opengl.lib gets somehow mixed and linker decides to use the real opengl.lib instead of mine.
I know I can solve this by renaming my wrapper functions to something else but I would like to use the same names.
This question relates to my previous question http://stackoverflow.com/questions/565459/c-wrapper-with-same-name
I am using Visual C++ with optimization disabled.