Jump to content
  • Advertisement
Sign in to follow this  
daniel_i_l

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 <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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!