problem of compling OpenGL+SDL in MS VC++6

I need to write crossplatform OpenGL code. glut and SDL is a good solution. I prefer to SDL+OpenGL. Compling SDL+OpenGL code is OK in linux. But the same code in VC failed, there are many errors in gl.h. I have added glu32.lib, openg32.lib, SDL.lib, SDLmain.lib into project.

If you’re looking for help, you might consider posting the actual errors that you are getting. We can’t actually diagnose the problem until then.

You probably need to include windows.h before gl.h.

This thread is a few days old, but I better point out that you should include “SDL_opengl.h” instead of gl.h because of the portability issues. As pointed out above, you need windows.h for Windows, but the GL headers are “OpenGL/gl.h” on the Mac.