PDA

View Full Version : GLUT with CodeWarrior



escozooz
02-24-2002, 08:49 PM
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.

escozooz
02-24-2002, 09:29 PM
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.

zlieb
02-28-2002, 06:17 AM
I've been programming with glut and codewarrior for about 2 days now http://www.opengl.org/discussion_boards/ubb/smile.gif 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

escozooz
03-03-2002, 09:26 AM
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

InTheZone
03-13-2002, 07:36 AM
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...