Problems with CodeWarrior and GLUT

I can’t get CW to compile even simple GLUT pgms. Every attempt fails with CW spitting out an error about “preprocessor #error directive” in excpt.h (included by windows.h).

If I comment out that section of excpt.h:

#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: …

everything works.

I have included all the files as per RobertSI’s post on 05-23-2000 but I still get the error. Regular OpenGL (w/o GLUT) compiles fine.

Any Help is greatly appreciated.
Aaron White

Just adding this before you include windows.h should work.

#define _WIN32

It seems weird that CW wouldn’t do that in your project for you. VC++ has settings where you can add whatever #defines you want to the project. I would assume CW has something similiar so you can try to add _WIN32 there too.


That fixed all the problems I’ve discovered so far.

#define WIN32_LEAN_AND_MEAN is included in glut.h already so I took that out.

Thank You

Aaron White