GLUT with CodeWarrior

Hello,

I have been using openGL for a few month with GLUT on a windows98 machine.  I have written some simple stuff but I started learning ogl with VC++, which I do not care for.  I want to start using Codewarrior, which is what I am the most familiar with, and I have all of the libraries moved to where they are supposed to be but when I got to run a program with GLUT it gives me these errors:

Error : ambiguous access to overloaded function
glut.h line 486 nit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }

Error : ambiguous access to overloaded function
glut.h line 503 _ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }

Error : ambiguous access to overloaded function
glut.h line 549 CK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }

These are the only ones. Although I am sure it is my fault that this does not run, I am stumped about how to fix it. I have the includes glut.h, gl.h, glu.h and the libraries opengl32, glaux, glu32, and glut32 are in the project.

Could someone give me some tips on how to resolve these errors?

Thank you,

Matt.

Ok, I changed my CW project to a Win32 C++ Console App, and now I have:

opengl32, glu32, glut32, and glaux in the project.

I have included only glut and I have only one error.

Error : Declaration syntax error
glut.h line 50 typedef unsigned short wchar_t;

making progress i suppose.

I’ve been programming with glut and codewarrior for about 2 days now and my fix for the first problem was to change :

exit

to

std::exit

I’m not sure where the conflict was but in my case it was namespace related. If I figure out more, I’ll let you know.

zach

Hi,

Sorry for being such a newbie but I still have one error. I made a C++ Console App in Codewarrior and I have glut32.lib, opengl32.lib, glaux32.lib, and glu32.lib.

It gives me this error in the glut.h file.

Error : declaration syntax error
glut.h line 50 typedef unsigned short wchar_t;

This is the source it points to.

/* XXX This is from Win32’s <ctype.h> */

ifndef _WCHAR_T_DEFINED

typedef unsigned short wchar_t;

define _WCHAR_T_DEFINED

endif

endif

zlieb, your problem is with your namespace command. You need to include “using namespace std;” at the top of your program (I put mine right below the #include statements). Once you do this, you can use the exit() method.

Hope that helps…