I am cross-compiling on Linux, wanted to compile for Windows with MingW32 using Code::Blocks, followed instructions on this page:
link, it seems to work, but the problem is only one OpenGL instruction:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
.
The compiler tells "GL_GENERATE_MIPMAP was not declared in this scope".
What I am doing wrong?
When I do the same for Linux using the default GNU GCC Compiler everything is fine.
The Windows OpenGL ABI only covers OpenGL-1.1 which means, that any OpenGL functionality that goes beyond that version can be reached only through the extension mechanism.
In your case all you need is an additional token. There should be an additional set of include directories for your MinGW cross compiler. At least one in /usr
and one in /usr/local
(by that I do not mean the usual /usr/include
and /usr/local/include
directories).
Head over to http://opengl.org/registry grab the glext.h
header provided there and put it into the directory /usr/local/$MINGW_INCLUDE/GL
. Then add this file to the headers included in your programs source code. That should give you the token.