Skip to main content
GameDev.net gamedev.net
🔒 Locked

VC++ gl

Started by daniel_i_l Aug 12, 2006 at 6:21 PM 2 replies 1.1k views
Original Post
daniel_i_l
daniel_i_l
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.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
SiCrane
SiCrane
Did you include windows.h before gl.h?
daniel_i_l
daniel_i_l
No. Could you explain why I need to do this in VC++ and not in dev?
Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Doggan
Doggan
Quote:
Original post by daniel_i_l
No. 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 statement before the #include. 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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.