Code::Blocks Forums

User forums => Help => Topic started by: himaja on October 04, 2005, 07:25:29 pm

Title: Problem using GLUT with Code::Blocks
Post by: himaja on October 04, 2005, 07:25:29 pm

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.
Title: Re: Problem using GLUT with Code::Blocks
Post by: fili on May 31, 2006, 02:43:56 pm
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*/

This way the app gets compiled and runs.  :D
Title: Re: Problem using GLUT with Code::Blocks
Post by: iw2nhl on June 01, 2006, 01:47:49 am
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

It would be nice to understand the source of this bug and notify it to the developers.