missing ; before void in gl.h

Started by
5 comments, last by shakazed 20 years, 8 months ago
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?
Advertisement
_ALLWAYS_ #include <windows.h> _BEFORE_ gl.h.
Oh I knew that *hídes*
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]
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.
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
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]
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

This topic is closed to new replies.

Advertisement