APIENTRY undefined in framework.cpp
I get a compilation error when compiling framework.cpp because APIENTRY is not defined.
g++ -MMD -MP -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DTIXML_USE_STL -DFREEGLUT_STATIC -DLOAD_X11 -DDEBUG -D_DEBUG -I../freeglut-2.6.0/include -I../glload/include -I../glm-0.9.0.7 -I../tinyxml -I. -g -o "lib/Debug/framework.o" -c "framework.cpp" framework.cpp:121:15: error: expected initializer before ‘DebugFunc’
I am using the 64-bit version of Ubuntu 11.04, with the distro freeglut (version 2.6.0-1ubuntu2), and gmake for premake build platform.
APIENTRY is normally defined through /usr/include/GL/gl.h, but glload/include/glload/gl_3_3.h defines the include guard __gl_h_ to prevent it from being processed. Although gl_3_3.h defines APIENTRY, it undefines it at the end of the same file.
A simple workaround is to include -DAPIENTRY= to the failing command to having it compile properly. I used
make verbose=1 to have make print each command.
I used Mercurial to get the source. hg tip: 270:a841d616964c