Ramsey's OpenGL Compilation Guide
Standard linux concerns
- Use: #include<GL/glut.h>
- Use the following flags: -lglut -lGLU
example: g++ basic.cpp -lglut -lGLU -o basic
Standard cygwin concerns
(These have gotten much worse! Go see my code blog for more on this)
- Use: #include<GL/glut.h>
- Use the following flags: -lglut32 -lglu32 -lopengl32
Standard mac concerns (valid in 10.4.11)
- Change the include lines to look like:
#include <GLUT/glut.h>
- Use the flags: -framework GLUT -framework OpenGL
example: g++ basic.cpp -framework GLUT -framework OpenGL
Standard windows concerns - using Microsoft Visual Studios .NET
- Make sure your windows has glut:
- Place glut32.dll in C:\WINDOWS\system
- Place glut32.lib in
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib (updated 8/30/12)
- Place glut.h in
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL (updated 8/30/12)
(may have to create GL directory)
- Alternatively you may go to http://www.xmission.com/~nate/glut.html and get glut (or click the links above for version 3.7.6).
- Set up Visual Studios
- Getting the Project Open
- File -> New -> Project -> Visual C++ Projects -> Win32 Console Projects
- Application Settings -> Empty Project
- If you don't want the terminal window: press Alt-F7, Expand Configuration Properties, Expand C/C++, click on Command Line -> Under Additional Options type: /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
- Use Release for the configuration options for a smaller executable