0

I have written a simple code to test my Eclipse. In the program I do not get any error but when I build the program I get the following error message :

ERROR

PROGRAM

1 Answers1

4

There is a hack in GLUT, referred to as "ATEXIT_HACK". It is designed to workaround issues related to using different Visual C++ Runtime library linker options between the GLUT DLL and your application.

This hack should not be used with MinGW since it has its own C standard library, it is only necessary in Microsoft Visual C++. Unfortunately, the GLUT library tries to apply this hack anytime _WIN32 is defined irrespective of the compiler used.

As such, you can add this preceding #include <glut.h>:

#ifndef _MSC_VER
# define GLUT_DISABLE_ATEXIT_HACK
#endif

Since you are using Eclipse, it should also be possible to add this pre-processor definition as a project option, but I could not tell you how to do that.

Community
  • 1
  • 1
Andon M. Coleman
  • 42,359
  • 2
  • 81
  • 106