You are here:

C++/problem with glut.h header file


glut.h error
glut.h error  
good day, I try to compile a program and the error I get is
C:/unisa/mingw/include/gl/glut.h:47: error: redeclaration of C++ built-in type `short'

mingw32-make: *** [first.o] Error 1

line --- typedef unsigned short wchar_t; (in the glut.h file)

no clue how to fix this, new to openGL

wchar_t is usually defined by the compiler environment.  Try commenting out this line and see if it isn't needed.

I can't make out the glut.h screen shots - thanks for including them though.

Let me know what else you try.  Sometimes these things are solved by trial an error because something else is causing the error.



All Answers

Answers by Expert:

Ask Experts


Bill A


I can answer questions about C++, programming algorithms, Windows programming in MFC (which is C++). I cannot answer questions about STL (templates) and I have no experience with Linux. I do enjoy reviewing code and critiquing it or finding problems in it. I will also gladly show better algorithms or methods if you want to take advantage of that.


I've developed a commercial embedded C compiler/assembler and IDE with debugger toolset, of which the IDE and debugger are written in C++. I work in the industry writing high tech embedded programs and Windows programs to communicate with the embedded devices.

Book: Embedded Systems Design using the Rabbit 3000 Microprocessor Authored Chapter 10 in its entirety.

BS Computer Engineering

©2016 All rights reserved.