User forums > Help
Problem using GLUT with Code::Blocks
(1/1)
himaja:
Hi,
I have been trying to use Code::Blocks along with OpenGL and GLUT, using MinGW. Unfortunately, whenever I try compiling a program which uses "glut.h" I get an error which reads to the effect of "Redefining C++ static variable:short". I am a new programmer to MinGW, OpenGL AND GLUT, so I would appreciate any help given.
Thanks,
Himaja.
fili:
Hello. I've run into this problem too. The solution (well, it's my solution, I don't know if it's the right way to do it) is to comment that lines.
--- Code: ---/* XXX This is from Win32's <ctype.h> */
/*
# ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
# define _WCHAR_T_DEFINED
# endif*/
--- End code ---
This way the app gets compiled and runs. :D
iw2nhl:
I found that in the past (Feb 2004) there has been a discussion to add that lines to make GLUT compile in windows-cygwin.
See here:
http://www.cygwin.com/ml/cygwin/2004-02/msg00993.html
Another way to solve the bug (without modifying external files) may be to add a define:
--- Code: ---#define _WCHAR_T_DEFINED 1
--- End code ---
It would be nice to understand the source of this bug and notify it to the developers.
Navigation
[0] Message Index
Go to full version