PDA

View Full Version : Problems include glu.h



ToddAtWSU
09-24-2007, 11:16 AM
I am trying to #include <gl\glu.h> inside windows running VS 2003.NET. After adding the include line to my .h file I get 100+ errors, apparently with "gl\gl.h". Here is a sampling of the errors I am getting.


C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2146: syntax error : missing ';' before identifier 'glAccum'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2086: 'int WINGDIAPI' : redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2182: 'APIENTRY' : illegal use of type 'void'
How do I get around these errors, especially since I did not create them. Thanks!

Overmind
09-24-2007, 12:28 PM
You have to include <windows.h> before any OpenGL headers.

ToddAtWSU
09-24-2007, 12:32 PM
I had just found that searching through google, but thanks!

Trenki
09-24-2007, 02:52 PM
And also don't ever use a backslash in your includes!!! -> #include <GL/gl.h>