Skip to main content
1 of 3
user1640736
  • 175
  • 2
  • 12

Exit() redefinition while using Opengl

I am using Visual C++ 2010 and I get the following errors:

1>d:\visual c++\vc\include\stdlib.h(353): error C2381: 'exit' : redefinition; __declspec(noreturn) differs
1>d:\glut-3.7.6-bin\include\gl\glut.h(146) : see declaration of 'exit'

In my project I have 3 files and I will paste the include part from each of them.

Main.cpp

#include<iostream>
#include "BmpLoader.h"
#include<glut.h>

BmpLoader.h

#include<stdio.h>
#include<glut.h>
#include<Windows.h>

BmpLoader.cpp

#include "BmpLoader.h"

As far as I know I recive this error due to the including order.I have tried so far serval including orders but I can't realise how I should include them so it works.

I would like an answere which describes the following:

What library combination causes this error and what includeing order should I use in order not to recive the error.

user1640736
  • 175
  • 2
  • 12