Archived

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

shakazed

missing ; before void in gl.h

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