Compiling a file that uses OpenGL with Visual C++, when I try to include the gl.h header file I get about 150 unhelpful compile errors:
error C2144: syntax error : 'void' should be preceded by ';'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2146: syntax error : missing ';' before identifier 'glAccum'
etc.
Just #include <windows.h>
before <gl/gl.h>
or <gl/glu.h>
.
It is needed for some types, such as WINGDIAPI
and APIENTRY
.
Sounds like you're including a C header inside a C++ project. Try enclosing your include statement inside:
extern "C" {
#include "gl.h"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With