Author Topic: Problem using GLUT with Code::Blocks  (Read 7764 times)

himaja

  • Guest
Problem using GLUT with Code::Blocks
« 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.

Offline fili

  • Multiple posting newcomer
  • *
  • Posts: 15
  • Meow
Re: Problem using GLUT with Code::Blocks
« Reply #1 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
Have FUN,
FeeL E!

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Problem using GLUT with Code::Blocks
« Reply #2 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.
« Last Edit: June 01, 2006, 02:28:46 am by iw2nhl »