View Full Version : strange problem with auxInitWindow

11-22-2002, 08:07 AM
This is a strange problem, maybe the real problem hides in somewhere else, but I just have no idea about it. Anyone can give me a clue?

The problem is about


compling error:

error C2664: 'auxInitWindowW' : cannot convert parameter 1 from 'char [6]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

[This message has been edited by anoaja (edited 11-22-2002).]

11-22-2002, 09:48 AM
Well.. aux is a bit outdated, but from the description of the error, it sounds like you are compiling with UNICODE enabled.

Here's a code snippit from glaux.h

#ifdef UNICODE
#define auxInitWindow auxInitWindowW
#define auxInitWindow auxInitWindowA
GLenum APIENTRY auxInitWindowA(LPCSTR);
GLenum APIENTRY auxInitWindowW(LPCWSTR);

Try either using the following line before you include glaux.h
#undef UNICODE

or using the Windows macro that converts ASCII chars to UNICODE chars. I think that would look something like so...


Note: I think the above only works if you've defined _UNICODE before windows.h, but I'm not certain of that. Haven't used Unicode much in C/C++.

11-25-2002, 04:45 AM
Thanks very much. I've got the idea. And if convince, could you please tell me something more? I'm just new for opengl. Why aux is a bit outdated? Then what's updated, glut?

11-25-2002, 05:14 AM
glAux is seldom used anymore. It is Windows only, and often times can be difficult to get a library for even Windows compilers that are not MS VC++.

Glut is a good alternative, but there are also others like SDL.