strange problem with auxInitWindow

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

  auxInitWindow("Title");

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).]

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
#else
#define auxInitWindow auxInitWindowA
#endif
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…

auxInitWindow(_TEXT(“Title”));

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++.

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?

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.