<p>What are the basic steps to compile an OpenGL application using <em>GLUT (OpenGL Utility Toolkit)</em> under Visual C++ Express Edition?</p>

[{'answer_id': 14265, 'author': 'Ashwin Nanjappa', 'author_id': 1630, 'author_profile': 'https://Stackoverflow.com/users/1630', 'pm_score': 4, 'selected': True, 'text': '<ol>\n<li>If you don\'t have Visual C++ Express Edition (VCEE), download and install <a href="http://msdn.microsoft.com/vstudio/express/visualc/default.aspx" rel="nofollow noreferrer">VCEE</a>.</li>\n<li>The default install of Visual C++ Express Edition builds for the .Net platform. We\'ll need to build for the Windows platform since OpenGL and GLUT are not yet fully supported under .Net. For this we need the Microsoft Platform SDK. (If you\'re using an older version of VCEE, download and install the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5" rel="nofollow noreferrer">Microsoft Platform SDK</a>. Visual C++ Express Edition will need to be configured to build for Windows platform. All these instructions are available <a href="http://msdn.microsoft.com/en-us/library/ms235626(VS.80).aspx" rel="nofollow noreferrer">here</a>.)</li>\n<li>If you don\'t have GLUT, download and unzip Nate Robin\'s <a href="http://www.xmission.com/~nate/glut.html" rel="nofollow noreferrer">Windows port of GLUT</a>.</li>\n<li>Add <strong>glut.h</strong> to your <em>Platform SDK/include/GL/</em> directory</li>\n<li>Link the project with <strong>glut.lib</strong>. (Go to VCEE <em>Project Properties -> Additional Linker Directories</em> and add the directory which has <strong>glut.lib</strong>.</li>\n<li>Add <strong>glut.dll</strong> to the <em>Windows/System32</em> directory, so that all programs using GLUT\ncan find it at runtime.</li>\n</ol>\n\n<p>Your program which uses GLUT or OpenGL should compile under Visual C++ Express Edition now.</p>\n'}, {'answer_id': 112729, 'author': 'Baxissimo', 'author_id': 9631, 'author_profile': 'https://Stackoverflow.com/users/9631', 'pm_score': 3, 'selected': False, 'text': '<p>The GLUT port on Nate Robin\'s site is from 2001 and has some incompatibilities with versions of Visual Studio more recent than that (.NET 2003 and up).  The incompatibility manifests itself as errors about redefinition of <code>exit()</code>. If you see this error, there are two possible solutions:</p>\n\n<ol>\n<li>Replace the <code>exit()</code> prototype in <code>glut.h</code> with the one in your <code>stdlib.h</code> so that they match. This is probably the best solution.</li>\n<li>An easier solution is to <code>#define GLUT_DISABLE_ATEXIT_HACK</code> before you <code>#include &lt;gl/glut.h&gt;</code> in your program.</li>\n</ol>\n\n<p>(Due credit: I originally saw this advice on the <a href="http://helpdesk.cs.tamu.edu/docs/glut_Visual_Studio2003" rel="noreferrer">TAMU help desk website</a>.)</p>\n\n<p>I\'ve been using approach #1 myself since .NET 2003 came out, and have used the same modified <code>glut.h</code> with VC++ 2003, VC++ 2005 and VC++ 2008.</p>\n\n<p>Here\'s the diff for the glut.h I use which does #1 (but in appropriate <code>#ifdef blocks</code> so that it still works with older versions of Visual Studio):</p>\n\n<pre><code>--- c:\\naterobbins\\glut.h       2000-12-13 00:22:52.000000000 +0900\n+++ c:\\updated\\glut.h    2006-05-23 11:06:10.000000000 +0900\n@@ -143,7 +143,12 @@\n\n #if defined(_WIN32)\n # ifndef GLUT_BUILDING_LIB\n-extern _CRTIMP void __cdecl exit(int);\n+/* extern _CRTIMP void __cdecl exit(int);  /* Changed for .NET */\n+#  if _MSC_VER &gt;= 1200\n+extern _CRTIMP __declspec(noreturn) void __cdecl exit(int);\n+#  else\n+extern _CRTIMP void __cdecl exit(int);\n+#  endif\n # endif\n #else\n /* non-Win32 case. */\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/14264', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1630/']