<p>In my simple OpenGL program I get the following error about exit redefinition:</p>

<pre><code>1&gt;c:\program files\microsoft visual studio 8\vc\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs
1&gt;        c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\glut.h(146) : see declaration of 'exit'
</code></pre>

<p>I'm using Nate Robins' <a href="http://www.xmission.com/~nate/glut.html" rel="noreferrer">GLUT for Win32</a> and get this error with Visual Studio 2005 or Visual C++ 2005 (Express Edition). What is the cause of this error and how do I fix it?</p>

[{'answer_id': 14403, 'author': 'Ashwin Nanjappa', 'author_id': 1630, 'author_profile': 'https://Stackoverflow.com/users/1630', 'pm_score': 7, 'selected': True, 'text': '<p><strong>Cause:</strong></p>\n\n<p>The <strong>stdlib.h</strong> which ships with the recent versions of Visual Studio has a different (and conflicting) definition of the <strong>exit()</strong> function. It clashes with the definition in <strong>glut.h</strong>.</p>\n\n<p><strong>Solution:</strong></p>\n\n<p>Override the definition in glut.h with that in stdlib.h. Place the stdlib.h line above the glut.h line in your code.</p>\n\n<pre><code>#include &lt;stdlib.h&gt;\n#include &lt;GL/glut.h&gt;\n</code></pre>\n'}, {'answer_id': 1689566, 'author': 'Alex', 'author_id': 205130, 'author_profile': 'https://Stackoverflow.com/users/205130', 'pm_score': 4, 'selected': False, 'text': '<p>or this...\nTo fix the error, right click on the project name in the Solution Explorer tab and select Properties -> C/C++ -> Preprocessor -> Preprocessor definitions and append GLUT_BUILDING_LIB to the existing definitions, seperated by semicolons. </p>\n'}]
['https://Stackoverflow.com/questions/14402', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1630/']