compiling openGL with VC++ STL

Hi!
I have a DLL that compiles perfectly in VC++6 and uses the templates

#include
#include
#include

but when I include the following headers

#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The Glaux Library

I get these errors:

c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ‘;’ before type ‘void’
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: ‘WINGDIAPI’ : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found

Please, does anyone know a solution?
Do I have to include other templates?

Thank you,

guille

Include windows.h before those files.

Yes, I already did and I got:

c:\program files\microsoft visual studio\vc98\include\winuser.h(2998) : error C2143: syntax error : missing ‘)’ before ‘constant’
c:\program files\microsoft visual studio\vc98\include\winuser.h(2998) : error C2143: syntax error : missing ‘;’ before ‘constant’
c:\program files\microsoft visual studio\vc98\include\winuser.h(2998) : fatal error C1004: unexpected end of file found

And I also tried with winuser.h:

c:\program files\microsoft visual studio\vc98\include\winuser.h(39) : error C2146: syntax error : missing ‘;’ before identifier ‘HDWP’
c:\program files\microsoft visual studio\vc98\include\winuser.h(39) : fatal error C1004: unexpected end of file found

hmmm, not sure what youre problem is. But if are using STL then you should use the standard namespace.
So after youre header inclusion, add…
using namespace std;
Hope it works man.

Including windows.h before gl/gl.h is all you need to do to get get the OpenGL header included properly. If you get more/other compiler errors, it’s because of some other files you use.

Did you, by the way, include winuser.h before windows.h? Should be after, if you need to include it at all.

Yes! You were both right.
I was using the standard namespace.
I have included before afxwin.h and it works.

Thank you for such a quick answer!

[This message has been edited by guille (edited 12-06-2001).]