# VC++ gl

This topic is 4304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a strange problem with VC++ Express. Recently I downloaded the package that I need to do win32 programming. To test it I opened a NeHe example and it worked fine. But then I tried some of my own stuff and the compiler spouted error after error for every cpp file that included gl.h like this: c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1153) : error C2086: 'int WINGDIAPI' : redefinition c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1153) : error C2146: syntax error : missing ';' before identifier 'glAlphaFunc' .... How can it say that there're errors in the gl.h file? What should I do? Thanks.

##### Share on other sites
Did you include windows.h before gl.h?

##### Share on other sites
No. Could you explain why I need to do this in VC++ and not in dev?
Thanks.

##### Share on other sites
Quote:
 Original post by daniel_i_lNo. Could you explain why I need to do this in VC++ and not in dev?Thanks.

From OpenGL.org:

Also, note that you'll need to put an #include <windows.h> statement before the #include<GL/gl.h>. Microsoft requires system DLLs to use a specific calling convention that isn't the default calling convention for most Win32 C compilers, so they've annotated the OpenGL calls in gl.h with some macros that expand to nonstandard C syntax. This causes Microsoft's C compilers to use the system calling convention. One of the include files included by windows.h defines the macros.

• 15
• 9
• 13
• 41
• 15