Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

shakazed

missing ; before void in gl.h

This topic is 5458 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

Hi! Decided to try out OpenGL for a change, problem is that when I try to compile I get an error saying "error C2144: syntax error : missing '';'' before type ''void''" In gl.h I´m using VC++ 6.0 and Win XP. Anyone else got this problem?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
_ALLWAYS_ #include <windows.h> _BEFORE_ gl.h.

Share this post


Link to post
Share on other sites
Really? Or does this only go for the visual studio opengl header? I've never had such problems with mingw, and it would seem slightly strange that a platform independant api requires you to include windows.h, wouldnt it?

Marijn


[edited by - marijnh on August 12, 2003 5:56:36 AM]

Share this post


Link to post
Share on other sites
The OpenGL code is platform independent, but a particular implementation may not be, as seen in this thread where the header for MS''s implementation requires windows.h.

It is not unlikely that the header you use in mingw is special for that compiler, or that you indirectly include windows.h via other headers. For example, GLUT defines the necessary symbols before including GL/gl.h so no need to include windows.h there.

Share this post


Link to post
Share on other sites
I got my gl.h off the net i think, and i am certain i can use it without including windows.h - in fact i think i am using the same header when compiling under linux. (the wglSomething functions are in the windows headers, and no gl definitions have anything to do with non-primitive types, so i don''t see why a gl.h would require windows headers).


Marijn

Share this post


Link to post
Share on other sites
quote:
Original post by marijnh
I got my gl.h off the net i think, and i am certain i can use it without including windows.h - in fact i think i am using the same header when compiling under linux. (the wglSomething functions are in the windows headers, and no gl definitions have anything to do with non-primitive types, so i don't see why a gl.h would require windows headers).


Marijn



Because of the APIENTRY and WINGDIAPI #definations.
You can not #include windows.h and
#define WINGDIAPI __declspec(dllimport)
#define APIENTRY __stdcall
before #including gl\gl.h

Edit: stupid tags

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

[edited by - shlomisteinberg on August 12, 2003 12:11:21 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!