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

missing ; before void in gl.h

Started by shakazed Aug 10, 2003 at 1:04 PM 5 replies 550+ views
Original Post
shakazed
shakazed
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?
marijnh
marijnh
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]
Brother Bob
Brother Bob
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.
marijnh
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
ShlomiSteinberg
ShlomiSteinberg
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)

Topic Locked

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

Sign in to reply to this topic.